feat(nix): add settings to automatically run the gc

this should make it slightly easier to use nix
without manually running the GC,
but also doesn't run anything in the bg for this
because that could be poor UX
This commit is contained in:
electria 2026-05-26 14:16:50 -07:00
commit 6b65b1d3fd
Signed by: electria
SSH key fingerprint: SHA256:8LlB3ucPbBHqozqkhsNbaV5oG3SlzzqUj8FZDL6IPQs

View file

@ -25,6 +25,13 @@ in
# source: https://nix.dev/manual/nix/2.26/command-ref/new-cli/nix3-store-optimise
nix.settings.auto-optimise-store = true;
# trigger the garbage collector automatically
# when free space in /nix/store goes below this
nix.settings.min-free = 1000000000; # 1GB
# free up to this many bytes in an automatic invocation
# to avoid it taking too long
nix.settings.max-free = 5000000000; # 5GB
environment.systemPackages =
with pkgs;
lib.mkIf config.nixowos.allowAddingPackages [