diff options
| author | Mark Nipper <nipsy@bitgnome.net> | 2025-12-04 01:20:38 -0800 |
|---|---|---|
| committer | Mark Nipper <nipsy@bitgnome.net> | 2025-12-04 01:20:38 -0800 |
| commit | e1bef478ffb2d8124e513c50d5ca5eb7a583000e (patch) | |
| tree | 4ee4569d3753efb71baaa202019ddaf3bcbcc09e /hosts/common/core/nix.nix | |
| parent | abddb01d087fb7e065891abebbe4286b6ce98b04 (diff) | |
| download | nix-e1bef478ffb2d8124e513c50d5ca5eb7a583000e.tar nix-e1bef478ffb2d8124e513c50d5ca5eb7a583000e.tar.gz nix-e1bef478ffb2d8124e513c50d5ca5eb7a583000e.tar.bz2 nix-e1bef478ffb2d8124e513c50d5ca5eb7a583000e.tar.lz nix-e1bef478ffb2d8124e513c50d5ca5eb7a583000e.tar.xz nix-e1bef478ffb2d8124e513c50d5ca5eb7a583000e.tar.zst nix-e1bef478ffb2d8124e513c50d5ca5eb7a583000e.zip | |
Add system wide and per user nix store garbage collection
Diffstat (limited to 'hosts/common/core/nix.nix')
| -rw-r--r-- | hosts/common/core/nix.nix | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/hosts/common/core/nix.nix b/hosts/common/core/nix.nix index 3c798ae..3aac7fc 100644 --- a/hosts/common/core/nix.nix +++ b/hosts/common/core/nix.nix @@ -1,6 +1,12 @@ { inputs, lib, ... }: { nix = { + gc = { + automatic = true; + dates = "daily"; + options = "--delete-older-than 7d"; + randomizedDelaySec = "5min"; + }; settings = { auto-optimise-store = lib.mkDefault true; experimental-features = [ "nix-command" "flakes" ]; @@ -8,4 +14,10 @@ warn-dirty = false; }; }; + + systemd.user.services."nix-gc" = { + description = "Garbage collection for user profiles"; + script = "/run/current-system/sw/bin/nix-collect-garbage --delete-older-than 7d"; + startAt = "daily"; + }; } |
