Merge pull request #40171 from teto/ntp

[RDY] openntpd: make -s flag work

Changed files
+6 -4
nixos
modules
services
networking
+6 -4
nixos/modules/services/networking/openntpd.nix
···
package = pkgs.openntpd_nixos;
-
cfgFile = pkgs.writeText "openntpd.conf" ''
+
configFile = ''
${concatStringsSep "\n" (map (s: "server ${s}") cfg.servers)}
${cfg.extraConfig}
'';
···
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>.
···
# 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;
···
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;
};