nixos ntpd: allow passing extra flags

This commit is contained in:
Luca Bruno 2015-09-10 10:56:18 +02:00
parent 873bd03458
commit f4b7be4f04

View File

@ -6,6 +6,8 @@ let
inherit (pkgs) ntp;
cfg = config.services.ntp;
stateDir = "/var/lib/ntp";
ntpUser = "ntp";
@ -16,10 +18,10 @@ let
restrict 127.0.0.1
restrict -6 ::1
${toString (map (server: "server " + server + " iburst\n") config.services.ntp.servers)}
${toString (map (server: "server " + server + " iburst\n") cfg.servers)}
'';
ntpFlags = "-c ${configFile} -u ${ntpUser}:nogroup";
ntpFlags = "-c ${configFile} -u ${ntpUser}:nogroup ${toString cfg.extraFlags}";
in
@ -51,6 +53,12 @@ in
'';
};
extraFlags = mkOption {
type = types.listOf types.str;
description = "Extra flags passed to the ntpd command.";
default = [];
};
};
};