1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-06 08:47:00 +00:00

nix-optimise: check for nix.enable

This was added to Nixpkgs in eb8b70c020e6693b29634660fa173d7f14f882eb.
This commit is contained in:
Emily 2025-02-10 19:15:18 +00:00
parent fc9367a9ec
commit 0176a5082b

View file

@ -52,15 +52,20 @@ in
###### implementation
config = mkIf cfg.automatic {
config = {
assertions = [
{
assertion = cfg.automatic -> config.nix.enable;
message = ''nix.optimise.automatic requires nix.enable'';
}
];
launchd.daemons.nix-optimise = {
launchd.daemons.nix-optimise = mkIf cfg.automatic {
command = "${lib.getExe' config.nix.package "nix-store"} --optimise";
serviceConfig = {
RunAtLoad = false;
StartCalendarInterval = cfg.interval;
};
};
};
}