diff --git a/nixos/modules/services/networking/chrony.nix b/nixos/modules/services/networking/chrony.nix index ff62acff6eb..9741c039cbc 100644 --- a/nixos/modules/services/networking/chrony.nix +++ b/nixos/modules/services/networking/chrony.nix @@ -30,6 +30,8 @@ let ${cfg.extraConfig} ''; + chronyFlags = "-n -m -u chrony -f ${configFile} ${toString cfg.extraFlags}"; + in { @@ -76,6 +78,13 @@ in chrony.conf ''; }; + + extraFlags = mkOption { + default = []; + example = [ "-s" ]; + type = types.listOf types.str; + description = "Extra flags passed to the chronyd command."; + }; }; }; @@ -123,7 +132,7 @@ in ''; serviceConfig = - { ExecStart = "${pkgs.chrony}/bin/chronyd -n -m -u chrony -f ${configFile}"; + { ExecStart = "${pkgs.chrony}/bin/chronyd ${chronyFlags}"; }; };