forked from mirrors/nixpkgs
nixos/chrony: add option to enable NTS authentication
This commit is contained in:
parent
fd0c2add78
commit
9550d865e9
|
@ -10,7 +10,7 @@ let
|
|||
keyFile = "${stateDir}/chrony.keys";
|
||||
|
||||
configFile = pkgs.writeText "chrony.conf" ''
|
||||
${concatMapStringsSep "\n" (server: "server " + server + " iburst") cfg.servers}
|
||||
${concatMapStringsSep "\n" (server: "server " + server + " iburst" + optionalString (cfg.enableNTS) " nts") cfg.servers}
|
||||
|
||||
${optionalString
|
||||
(cfg.initstepslew.enabled && (cfg.servers != []))
|
||||
|
@ -19,6 +19,7 @@ let
|
|||
|
||||
driftfile ${driftFile}
|
||||
keyfile ${keyFile}
|
||||
${optionalString (cfg.enableNTS) "ntsdumpdir ${stateDir}"}
|
||||
|
||||
${optionalString (!config.time.hardwareClockInLocalTime) "rtconutc"}
|
||||
|
||||
|
@ -46,6 +47,15 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
enableNTS = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to enable Network Time Security authentication.
|
||||
Make sure it is supported by your selected NTP server(s).
|
||||
'';
|
||||
};
|
||||
|
||||
initstepslew = mkOption {
|
||||
default = {
|
||||
enabled = true;
|
||||
|
|
Loading…
Reference in a new issue