nixos ntpd: allow passing extra flags

Changed files
+10 -2
nixos
modules
services
networking
+10 -2
nixos/modules/services/networking/ntpd.nix
···
inherit (pkgs) ntp;
stateDir = "/var/lib/ntp";
ntpUser = "ntp";
···
restrict 127.0.0.1
restrict -6 ::1
-
${toString (map (server: "server " + server + " iburst\n") config.services.ntp.servers)}
'';
-
ntpFlags = "-c ${configFile} -u ${ntpUser}:nogroup";
in
···
description = ''
The set of NTP servers from which to synchronise.
'';
};
};
···
inherit (pkgs) ntp;
+
cfg = config.services.ntp;
+
stateDir = "/var/lib/ntp";
ntpUser = "ntp";
···
restrict 127.0.0.1
restrict -6 ::1
+
${toString (map (server: "server " + server + " iburst\n") cfg.servers)}
'';
+
ntpFlags = "-c ${configFile} -u ${ntpUser}:nogroup ${toString cfg.extraFlags}";
in
···
description = ''
The set of NTP servers from which to synchronise.
'';
+
};
+
+
extraFlags = mkOption {
+
type = types.listOf types.str;
+
description = "Extra flags passed to the ntpd command.";
+
default = [];
};
};