nixos ntpd: allow passing extra flags
commitf4b7be4f049d6a1063075dc82749283d72b31b08
authorLuca Bruno <lethalman88@gmail.com>
dateThu 10 Sep 2015, 10:56 (11 years ago)
parent873bd03
nixos/modules/services/networking/ntpd.nix+10−2
@@ -6,6 +6,8 @@ let
66
77 inherit (pkgs) ntp;
88
9+ cfg = config.services.ntp;
10+
911 stateDir = "/var/lib/ntp";
1012
1113 ntpUser = "ntp";
@@ -16,10 +18,10 @@ let
1618 restrict 127.0.0.1
1719 restrict -6 ::1
1820
19− ${toString (map (server: "server " + server + " iburst\n") config.services.ntp.servers)}
21+ ${toString (map (server: "server " + server + " iburst\n") cfg.servers)}
2022 '';
2123
22− ntpFlags = "-c ${configFile} -u ${ntpUser}:nogroup";
24+ ntpFlags = "-c ${configFile} -u ${ntpUser}:nogroup ${toString cfg.extraFlags}";
2325
2426in
2527
@@ -51,6 +53,12 @@ in
5153 '';
5254 };
5355
56+ extraFlags = mkOption {
57+ type = types.listOf types.str;
58+ description = "Extra flags passed to the ntpd command.";
59+ default = [];
60+ };
61+
5462 };
5563
5664 };