mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 16:03:23 +00:00
nixos/chrony: add option to change package
This commit is contained in:
parent
2aec205bd2
commit
54778551d6
@ -4,6 +4,7 @@ with lib;
|
|||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.services.chrony;
|
cfg = config.services.chrony;
|
||||||
|
chronyPkg = cfg.package;
|
||||||
|
|
||||||
stateDir = cfg.directory;
|
stateDir = cfg.directory;
|
||||||
driftFile = "${stateDir}/chrony.drift";
|
driftFile = "${stateDir}/chrony.drift";
|
||||||
@ -40,6 +41,15 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.chrony;
|
||||||
|
defaultText = "pkgs.chrony";
|
||||||
|
description = ''
|
||||||
|
Which chrony package to use.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
servers = mkOption {
|
servers = mkOption {
|
||||||
default = config.networking.timeServers;
|
default = config.networking.timeServers;
|
||||||
description = ''
|
description = ''
|
||||||
@ -109,7 +119,7 @@ in
|
|||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
meta.maintainers = with lib.maintainers; [ thoughtpolice ];
|
meta.maintainers = with lib.maintainers; [ thoughtpolice ];
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.chrony ];
|
environment.systemPackages = [ chronyPkg ];
|
||||||
|
|
||||||
users.groups.chrony.gid = config.ids.gids.chrony;
|
users.groups.chrony.gid = config.ids.gids.chrony;
|
||||||
|
|
||||||
@ -139,12 +149,12 @@ in
|
|||||||
after = [ "network.target" ];
|
after = [ "network.target" ];
|
||||||
conflicts = [ "ntpd.service" "systemd-timesyncd.service" ];
|
conflicts = [ "ntpd.service" "systemd-timesyncd.service" ];
|
||||||
|
|
||||||
path = [ pkgs.chrony ];
|
path = [ chronyPkg ];
|
||||||
|
|
||||||
unitConfig.ConditionCapability = "CAP_SYS_TIME";
|
unitConfig.ConditionCapability = "CAP_SYS_TIME";
|
||||||
serviceConfig =
|
serviceConfig =
|
||||||
{ Type = "simple";
|
{ Type = "simple";
|
||||||
ExecStart = "${pkgs.chrony}/bin/chronyd ${chronyFlags}";
|
ExecStart = "${chronyPkg}/bin/chronyd ${chronyFlags}";
|
||||||
|
|
||||||
ProtectHome = "yes";
|
ProtectHome = "yes";
|
||||||
ProtectSystem = "full";
|
ProtectSystem = "full";
|
||||||
|
Loading…
Reference in New Issue
Block a user