nixos/nix-{gc,optimise}: do not start when switching
Co-authored-by: Sizhe Zhao <prc.zhao@outlook.com>
This commit is contained in:
parent
1755d9399b
commit
e9efb4240e
@ -88,6 +88,8 @@ in
|
|||||||
script = "exec ${config.nix.package.out}/bin/nix-collect-garbage ${cfg.options}";
|
script = "exec ${config.nix.package.out}/bin/nix-collect-garbage ${cfg.options}";
|
||||||
serviceConfig.Type = "oneshot";
|
serviceConfig.Type = "oneshot";
|
||||||
startAt = lib.optionals cfg.automatic cfg.dates;
|
startAt = lib.optionals cfg.automatic cfg.dates;
|
||||||
|
# do not start and delay when switching
|
||||||
|
restartIfChanged = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.timers.nix-gc = lib.mkIf cfg.automatic {
|
systemd.timers.nix-gc = lib.mkIf cfg.automatic {
|
||||||
|
|||||||
@ -69,6 +69,8 @@ in
|
|||||||
unitConfig.ConditionPathIsReadWrite = "/nix/var/nix/daemon-socket";
|
unitConfig.ConditionPathIsReadWrite = "/nix/var/nix/daemon-socket";
|
||||||
serviceConfig.ExecStart = "${config.nix.package}/bin/nix-store --optimise";
|
serviceConfig.ExecStart = "${config.nix.package}/bin/nix-store --optimise";
|
||||||
startAt = lib.optionals cfg.automatic cfg.dates;
|
startAt = lib.optionals cfg.automatic cfg.dates;
|
||||||
|
# do not start and delay when switching
|
||||||
|
restartIfChanged = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
timers.nix-optimise = lib.mkIf cfg.automatic {
|
timers.nix-optimise = lib.mkIf cfg.automatic {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user