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 = []; + }; + }; };