From 6b65b1d3fd7af9f8956b161e63bdb9751bf1a696 Mon Sep 17 00:00:00 2001 From: electria Date: Tue, 26 May 2026 14:16:50 -0700 Subject: [PATCH] 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 --- defaults/nix.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/defaults/nix.nix b/defaults/nix.nix index 2f1364a..6825299 100644 --- a/defaults/nix.nix +++ b/defaults/nix.nix @@ -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 [