openntpd: add extraConfig and extraOptions
This commit is contained in:
parent
e92c942d1d
commit
4fa5d1f626
@ -12,6 +12,7 @@ let
|
|||||||
|
|
||||||
cfgFile = pkgs.writeText "openntpd.conf" ''
|
cfgFile = pkgs.writeText "openntpd.conf" ''
|
||||||
${concatStringsSep "\n" (map (s: "server ${s}") cfg.servers)}
|
${concatStringsSep "\n" (map (s: "server ${s}") cfg.servers)}
|
||||||
|
${cfg.extraConfig}
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
@ -25,6 +26,27 @@ in
|
|||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
inherit (options.services.ntp.servers) description;
|
inherit (options.services.ntp.servers) description;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extraConfig = mkOption {
|
||||||
|
type = with types; lines;
|
||||||
|
default = "";
|
||||||
|
example = ''
|
||||||
|
listen on 127.0.0.1
|
||||||
|
listen on ::1
|
||||||
|
'';
|
||||||
|
description = ''
|
||||||
|
Additional text appended to <filename>openntpd.conf</filename>.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
extraOptions = mkOption {
|
||||||
|
type = with types; string;
|
||||||
|
default = "";
|
||||||
|
example = "-s";
|
||||||
|
description = ''
|
||||||
|
Extra options used when launching openntpd.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
###### implementation
|
###### implementation
|
||||||
@ -42,7 +64,7 @@ in
|
|||||||
systemd.services.openntpd = {
|
systemd.services.openntpd = {
|
||||||
description = "OpenNTP Server";
|
description = "OpenNTP Server";
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
serviceConfig.ExecStart = "${package}/sbin/ntpd -d -f ${cfgFile}";
|
serviceConfig.ExecStart = "${package}/sbin/ntpd -d -f ${cfgFile} ${cfg.extraOptions}";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user