1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-31 04:04:45 +00:00

nix-gc: check for nix.enable

This was added to Nixpkgs in eb8b70c020e6693b29634660fa173d7f14f882eb.

(cherry picked from commit fc9367a9ec)
This commit is contained in:
Emily 2025-02-10 19:14:24 +00:00
parent f81c16138a
commit 6374102082

View file

@ -62,15 +62,20 @@ in
###### implementation
config = mkIf cfg.automatic {
config = {
assertions = [
{
assertion = cfg.automatic -> config.nix.enable;
message = ''nix.gc.automatic requires nix.enable'';
}
];
launchd.daemons.nix-gc = {
launchd.daemons.nix-gc = mkIf cfg.automatic {
command = "${config.nix.package}/bin/nix-collect-garbage ${cfg.options}";
environment.NIX_REMOTE = optionalString config.nix.useDaemon "daemon";
serviceConfig.RunAtLoad = false;
serviceConfig.StartCalendarInterval = cfg.interval;
serviceConfig.UserName = cfg.user;
};
};
}