summary refs log tree commit diff
diff options
context:
space:
mode:
authorBen Wolsieffer <benwolsieffer@gmail.com>2021-01-31 18:48:15 -0500
committerBen Wolsieffer <benwolsieffer@gmail.com>2021-02-02 19:26:47 -0500
commit6f4e6cd819173f8d2aaebdc73b7583d6f10973bb (patch)
tree71c6fd5c77318625bdbb3d85abb8f458fa7a439d
parentac6ac61e3f4255ec7ebd9fad36f410dddb0fde7a (diff)
downloadnixpkgs-6f4e6cd819173f8d2aaebdc73b7583d6f10973bb.tar
nixpkgs-6f4e6cd819173f8d2aaebdc73b7583d6f10973bb.tar.gz
nixpkgs-6f4e6cd819173f8d2aaebdc73b7583d6f10973bb.tar.bz2
nixpkgs-6f4e6cd819173f8d2aaebdc73b7583d6f10973bb.tar.lz
nixpkgs-6f4e6cd819173f8d2aaebdc73b7583d6f10973bb.tar.xz
nixpkgs-6f4e6cd819173f8d2aaebdc73b7583d6f10973bb.tar.zst
nixpkgs-6f4e6cd819173f8d2aaebdc73b7583d6f10973bb.zip
nixos/chrony: split the initstepslew attrset into options
Add explicit options for initstepslew.enabled and initstepslew.threshold, rather
than using an attrset.
-rw-r--r--nixos/modules/services/networking/ntp/chrony.nix29
1 files changed, 19 insertions, 10 deletions
diff --git a/nixos/modules/services/networking/ntp/chrony.nix b/nixos/modules/services/networking/ntp/chrony.nix
index 96c6444c23a..18c19431df0 100644
--- a/nixos/modules/services/networking/ntp/chrony.nix
+++ b/nixos/modules/services/networking/ntp/chrony.nix
@@ -81,17 +81,26 @@ in
         '';
       };
 
-      initstepslew = mkOption {
-        type = types.attrsOf (types.either types.bool types.int);
-        default = {
-          enabled = true;
-          threshold = 1000; # by default, same threshold as 'ntpd -g' (1000s)
+      initstepslew = {
+        enabled = mkOption {
+          type = types.bool;
+          default = true;
+          description = ''
+            Allow chronyd to make a rapid measurement of the system clock error
+            at boot time, and to correct the system clock by stepping before
+            normal operation begins.
+          '';
+        };
+
+        threshold = mkOption {
+          type = types.either types.float types.int;
+          default = 1000; # by default, same threshold as 'ntpd -g' (1000s)
+          description = ''
+            The threshold of system clock error (in seconds) above which the
+            clock will be stepped. If the correction required is less than the
+            threshold, a slew is used instead.
+          '';
         };
-        description = ''
-          Allow chronyd to make a rapid measurement of the system clock error at
-          boot time, and to correct the system clock by stepping before normal
-          operation begins.
-        '';
       };
 
       directory = mkOption {