about summary refs log tree commit diff
path: root/nixos/modules/services
diff options
context:
space:
mode:
authoradisbladis <adisbladis@gmail.com>2020-03-12 16:37:25 +0000
committerGitHub <noreply@github.com>2020-03-12 16:37:25 +0000
commitf3adcbd15044283acf36d9c673312c89ec2f19da (patch)
tree985e05375c00296096839a0fc020467ed69da2be /nixos/modules/services
parent6881eb96a94eaf5b99f970f9b7c6d070c6e99c08 (diff)
parent63c35a9c289f4b49d57b727eaea8d345448e8495 (diff)
downloadnixlib-f3adcbd15044283acf36d9c673312c89ec2f19da.tar
nixlib-f3adcbd15044283acf36d9c673312c89ec2f19da.tar.gz
nixlib-f3adcbd15044283acf36d9c673312c89ec2f19da.tar.bz2
nixlib-f3adcbd15044283acf36d9c673312c89ec2f19da.tar.lz
nixlib-f3adcbd15044283acf36d9c673312c89ec2f19da.tar.xz
nixlib-f3adcbd15044283acf36d9c673312c89ec2f19da.tar.zst
nixlib-f3adcbd15044283acf36d9c673312c89ec2f19da.zip
Merge pull request #82411 from adisbladis/ntpd-extraconfig
services.ntpd: Add extraConfig parameter
Diffstat (limited to 'nixos/modules/services')
-rw-r--r--nixos/modules/services/networking/ntp/ntpd.nix13
1 files changed, 13 insertions, 0 deletions
diff --git a/nixos/modules/services/networking/ntp/ntpd.nix b/nixos/modules/services/networking/ntp/ntpd.nix
index b5403cb747d0..54ff054d84c7 100644
--- a/nixos/modules/services/networking/ntp/ntpd.nix
+++ b/nixos/modules/services/networking/ntp/ntpd.nix
@@ -23,6 +23,8 @@ let
     restrict -6 ::1
 
     ${toString (map (server: "server " + server + " iburst\n") cfg.servers)}
+
+    ${cfg.extraConfig}
   '';
 
   ntpFlags = "-c ${configFile} -u ${ntpUser}:nogroup ${toString cfg.extraFlags}";
@@ -81,6 +83,17 @@ in
         '';
       };
 
+      extraConfig = mkOption {
+        type = types.lines;
+        default = "";
+        example = ''
+          fudge 127.127.1.0 stratum 10
+        '';
+        description = ''
+          Additional text appended to <filename>ntp.conf</filename>.
+        '';
+      };
+
       extraFlags = mkOption {
         type = types.listOf types.str;
         description = "Extra flags passed to the ntpd command.";