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
|
||||
cfg = config.services.chrony;
|
||||
chronyPkg = cfg.package;
|
||||
|
||||
stateDir = cfg.directory;
|
||||
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 {
|
||||
default = config.networking.timeServers;
|
||||
description = ''
|
||||
@ -109,7 +119,7 @@ in
|
||||
config = mkIf cfg.enable {
|
||||
meta.maintainers = with lib.maintainers; [ thoughtpolice ];
|
||||
|
||||
environment.systemPackages = [ pkgs.chrony ];
|
||||
environment.systemPackages = [ chronyPkg ];
|
||||
|
||||
users.groups.chrony.gid = config.ids.gids.chrony;
|
||||
|
||||
@ -139,12 +149,12 @@ in
|
||||
after = [ "network.target" ];
|
||||
conflicts = [ "ntpd.service" "systemd-timesyncd.service" ];
|
||||
|
||||
path = [ pkgs.chrony ];
|
||||
path = [ chronyPkg ];
|
||||
|
||||
unitConfig.ConditionCapability = "CAP_SYS_TIME";
|
||||
serviceConfig =
|
||||
{ Type = "simple";
|
||||
ExecStart = "${pkgs.chrony}/bin/chronyd ${chronyFlags}";
|
||||
ExecStart = "${chronyPkg}/bin/chronyd ${chronyFlags}";
|
||||
|
||||
ProtectHome = "yes";
|
||||
ProtectSystem = "full";
|
||||
|
Loading…
Reference in New Issue
Block a user