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";
|
keyFile = "${stateDir}/chrony.keys";
|
||||||
|
|
||||||
configFile = pkgs.writeText "chrony.conf" ''
|
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
|
${optionalString
|
||||||
(cfg.initstepslew.enabled && (cfg.servers != []))
|
(cfg.initstepslew.enabled && (cfg.servers != []))
|
||||||
@ -19,6 +19,7 @@ let
|
|||||||
|
|
||||||
driftfile ${driftFile}
|
driftfile ${driftFile}
|
||||||
keyfile ${keyFile}
|
keyfile ${keyFile}
|
||||||
|
${optionalString (cfg.enableNTS) "ntsdumpdir ${stateDir}"}
|
||||||
|
|
||||||
${optionalString (!config.time.hardwareClockInLocalTime) "rtconutc"}
|
${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 {
|
initstepslew = mkOption {
|
||||||
default = {
|
default = {
|
||||||
enabled = true;
|
enabled = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user