mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-25 12:22:37 +03:00
nixos ntpd: allow passing extra flags
This commit is contained in:
parent
873bd03458
commit
f4b7be4f04
@ -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 = [];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user