From f4b7be4f049d6a1063075dc82749283d72b31b08 Mon Sep 17 00:00:00 2001 From: Luca Bruno Date: Thu, 10 Sep 2015 10:56:18 +0200 Subject: nixos ntpd: allow passing extra flags --- nixos/modules/services/networking/ntpd.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'nixos/modules/services/networking/ntpd.nix') diff --git a/nixos/modules/services/networking/ntpd.nix b/nixos/modules/services/networking/ntpd.nix index a9183577d0a2..5256fc9bc071 100644 --- a/nixos/modules/services/networking/ntpd.nix +++ b/nixos/modules/services/networking/ntpd.nix @@ -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 = []; + }; + }; }; -- cgit 1.4.1