mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-21 12:59:04 +02:00
nixos/chrony: add option to choose between two commonly used server directive options
This commit is contained in:
parent
9550d865e9
commit
2e131e1f45
|
@ -10,7 +10,7 @@ let
|
|||
keyFile = "${stateDir}/chrony.keys";
|
||||
|
||||
configFile = pkgs.writeText "chrony.conf" ''
|
||||
${concatMapStringsSep "\n" (server: "server " + server + " iburst" + optionalString (cfg.enableNTS) " nts") cfg.servers}
|
||||
${concatMapStringsSep "\n" (server: "server " + server + " " + cfg.serverOption + optionalString (cfg.enableNTS) " nts") cfg.servers}
|
||||
|
||||
${optionalString
|
||||
(cfg.initstepslew.enabled && (cfg.servers != []))
|
||||
|
@ -47,6 +47,20 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
serverOption = mkOption {
|
||||
default = "iburst";
|
||||
type = types.enum [ "iburst" "offline" ];
|
||||
description = ''
|
||||
Set option for server directives.
|
||||
|
||||
Use "iburst" to rapidly poll on startup. Recommended if your machine
|
||||
is consistently online.
|
||||
|
||||
Use "offline" to prevent polling on startup. Recommended if your
|
||||
machine boots offline or is otherwise frequently offline.
|
||||
'';
|
||||
};
|
||||
|
||||
enableNTS = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
|
|
Loading…
Reference in a new issue