mirror of
https://github.com/srid/nixos-config.git
synced 2026-07-16 22:01:33 +08:00
...
This commit is contained in:
parent
54e0b0f276
commit
5eaa6b9671
8 changed files with 72 additions and 13 deletions
18
modules/nixos/linux/gc.nix
Normal file
18
modules/nixos/linux/gc.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# System-level Nix garbage collection + store optimisation.
|
||||
#
|
||||
# The home-manager `nix.gc` (modules/home/nix/gc.nix) runs as the user, so it
|
||||
# can prune the *user* profile and collect the store, but it can never touch
|
||||
# the root-owned `system-*` profile generations. Without a system-level GC,
|
||||
# those pile up unbounded — pureintent accumulated ~480 system generations
|
||||
# (~4 months of daily rebuilds), each pinning a full closure and keeping old
|
||||
# kernels/packages from ever being collected. This prunes them; auto-optimise
|
||||
# hardlinks identical files across the closures that remain.
|
||||
{ ... }:
|
||||
{
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 30d";
|
||||
};
|
||||
nix.settings.auto-optimise-store = true;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue