mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-31 04:04:45 +00:00
nix-optimise: check for nix.enable
This was added to Nixpkgs in eb8b70c020e6693b29634660fa173d7f14f882eb.
(cherry picked from commit 0176a5082b
)
This commit is contained in:
parent
6374102082
commit
be5f5c546f
1 changed files with 8 additions and 3 deletions
|
@ -58,9 +58,15 @@ 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 {
|
||||
environment.NIX_REMOTE = optionalString config.nix.useDaemon "daemon";
|
||||
command = "${lib.getExe' config.nix.package "nix-store"} --optimise";
|
||||
serviceConfig = {
|
||||
|
@ -69,6 +75,5 @@ in
|
|||
UserName = cfg.user;
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue