Merge pull request #69387 from peterhoeg/f/optimise
nixos/nix-optimise: be smarter about when we run the store optimiser
This commit is contained in:
commit
8cc9d24fe1
@ -40,8 +40,8 @@ in
|
|||||||
|
|
||||||
systemd.services.nix-optimise =
|
systemd.services.nix-optimise =
|
||||||
{ description = "Nix Store Optimiser";
|
{ description = "Nix Store Optimiser";
|
||||||
# No point running it inside a nixos-container. It should be on the host instead.
|
# No point this if the nix daemon (and thus the nix store) is outside
|
||||||
unitConfig.ConditionVirtualization = "!container";
|
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 = optionals cfg.automatic cfg.dates;
|
startAt = optionals cfg.automatic cfg.dates;
|
||||||
};
|
};
|
||||||
|
@ -7,6 +7,7 @@ with lib;
|
|||||||
config = mkIf config.boot.isContainer {
|
config = mkIf config.boot.isContainer {
|
||||||
|
|
||||||
# Disable some features that are not useful in a container.
|
# Disable some features that are not useful in a container.
|
||||||
|
nix.optimise.automatic = mkDefault false; # the store is host managed
|
||||||
services.udisks2.enable = mkDefault false;
|
services.udisks2.enable = mkDefault false;
|
||||||
powerManagement.enable = mkDefault false;
|
powerManagement.enable = mkDefault false;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user