Add GC
This commit is contained in:
31
modules/common/garbage-collection.nix
Normal file
31
modules/common/garbage-collection.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
# ─────────────────────────────────────────────
|
||||
# Bootloader generation limit (rollback window)
|
||||
# ─────────────────────────────────────────────
|
||||
boot.loader.systemd-boot.configurationLimit = 3;
|
||||
# If you're using GRUB instead, use this instead:
|
||||
# boot.loader.grub.configurationLimit = 3;
|
||||
|
||||
# ─────────────────────────────────────────────
|
||||
# Nix garbage collection (tight retention)
|
||||
# ─────────────────────────────────────────────
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
dates = "daily";
|
||||
options = "--delete-older-than 3d";
|
||||
};
|
||||
|
||||
# ─────────────────────────────────────────────
|
||||
# Store optimisation (reduce disk bloat)
|
||||
# ─────────────────────────────────────────────
|
||||
nix.settings.auto-optimise-store = true;
|
||||
|
||||
# ─────────────────────────────────────────────
|
||||
# Optional: keep system leaner overall
|
||||
# (reduces leftover system profiles slightly)
|
||||
# ─────────────────────────────────────────────
|
||||
nix.settings.keep-outputs = false;
|
||||
nix.settings.keep-derivations = false;
|
||||
}
|
||||
Reference in New Issue
Block a user