diff options
author | Matthew Justin Bauer <mjbauer95@gmail.com> | 2018-06-01 23:16:20 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-01 23:16:20 -0400 |
commit | 20ca7af00fc561a94e9b2bf09b11156cbb5125b1 (patch) | |
tree | 11bb0757c44a9748acfc23c5190e3fbb39c82c7f /nixos | |
parent | ed2177bb086b454f35582d9a978726a121d6172b (diff) | |
parent | f5e169c608f738de2469af27770f9a95d60faf82 (diff) | |
download | nixlib-20ca7af00fc561a94e9b2bf09b11156cbb5125b1.tar nixlib-20ca7af00fc561a94e9b2bf09b11156cbb5125b1.tar.gz nixlib-20ca7af00fc561a94e9b2bf09b11156cbb5125b1.tar.bz2 nixlib-20ca7af00fc561a94e9b2bf09b11156cbb5125b1.tar.lz nixlib-20ca7af00fc561a94e9b2bf09b11156cbb5125b1.tar.xz nixlib-20ca7af00fc561a94e9b2bf09b11156cbb5125b1.tar.zst nixlib-20ca7af00fc561a94e9b2bf09b11156cbb5125b1.zip |
Merge pull request #40171 from teto/ntp
[RDY] openntpd: make -s flag work
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/networking/openntpd.nix | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/nixos/modules/services/networking/openntpd.nix b/nixos/modules/services/networking/openntpd.nix index 4bb9da54fe09..241038ca12ed 100644 --- a/nixos/modules/services/networking/openntpd.nix +++ b/nixos/modules/services/networking/openntpd.nix @@ -7,7 +7,7 @@ let package = pkgs.openntpd_nixos; - cfgFile = pkgs.writeText "openntpd.conf" '' + configFile = '' ${concatStringsSep "\n" (map (s: "server ${s}") cfg.servers)} ${cfg.extraConfig} ''; @@ -31,8 +31,8 @@ in type = with types; lines; default = ""; example = '' - listen on 127.0.0.1 - listen on ::1 + listen on 127.0.0.1 + listen on ::1 ''; description = '' Additional text appended to <filename>openntpd.conf</filename>. @@ -57,6 +57,8 @@ in # Add ntpctl to the environment for status checking environment.systemPackages = [ package ]; + environment.etc."ntpd.conf".text = configFile; + users.extraUsers = singleton { name = "ntp"; uid = config.ids.uids.ntp; @@ -71,7 +73,7 @@ in before = [ "time-sync.target" ]; after = [ "dnsmasq.service" "bind.service" "network-online.target" ]; serviceConfig = { - ExecStart = "${package}/sbin/ntpd -f ${cfgFile} -p ${pidFile} ${cfg.extraOptions}"; + ExecStart = "${package}/sbin/ntpd -p ${pidFile} ${cfg.extraOptions}"; Type = "forking"; PIDFile = pidFile; }; |