Files
nixos-at-home/modules/common/garbage-collection.nix
HotaruBlaze bfdcbd6594 Add GC
2026-05-31 11:08:04 +00:00

31 lines
1.7 KiB
Nix

{ 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;
}