feat(nixos): prune system+HM gens after 14d, keep ≥3 past (#128)
Some checks failed
Check / eval (push) Has been cancelled

Weekly nomarchy-gen-prune deletes only generations that are both older
than 14 days and beyond the three most recent past gens (current always
kept), for system and Home Manager profiles. Stock nix.gc no longer uses
--delete-older-than. checks.gen-prune covers selection self-test and
unit wiring; doctor points at the new tool when disk is tight.
This commit is contained in:
2026-07-15 11:59:26 +01:00
parent 1f6f21249e
commit e4800d7d8e
9 changed files with 344 additions and 45 deletions

View File

@@ -35,7 +35,11 @@ let
in if builtins.isBool v then v else null;
in
{
imports = [ ./options.nix ./plymouth.nix ./greeter.nix ./file-manager.nix ./power.nix ./services.nix ./hardware.nix ./timezone.nix ./oom.nix ];
imports = [
./options.nix ./plymouth.nix ./greeter.nix ./file-manager.nix
./power.nix ./services.nix ./hardware.nix ./timezone.nix ./oom.nix
./gen-prune.nix # #128 system+HM generation prune (14d, keep ≥3 past)
];
config = {
# Distro branding. distroName flows into /etc/os-release PRETTY_NAME,
@@ -512,11 +516,8 @@ in
# dirty" warning fires on every rebuild and is pure noise here.
warn-dirty = lib.mkDefault false;
};
gc = {
automatic = lib.mkDefault true;
dates = lib.mkDefault "weekly";
options = lib.mkDefault "--delete-older-than 14d";
};
# Generation age+floor policy + store GC: modules/nixos/gen-prune.nix (#128).
};
};
}