From 9381f3e070217f61b3538d2d07e3669b896bc696 Mon Sep 17 00:00:00 2001 From: kiskaadee Date: Wed, 14 Oct 2026 13:41:17 -0500 Subject: [PATCH] feat(nixos): configure automated nix store garbage collection and deduplication - Enable weekly garbage collection retaining generations newer than 14 days - Enable automatic nix store hardlink deduplication --- nixos/configuration.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 46bf4a5..d6d4e3e 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -19,12 +19,20 @@ sops.defaultSopsFile = ./secrets.yaml; sops.defaultSopsFormat = "yaml"; - # ── Nix settings ───────────────────────────────────────────────────────────── + # ── Nix settings & maintenance ─────────────────────────────────────────────── nix.settings.experimental-features = [ "nix-command" "flakes" ]; # Pin nixpkgs registry to the flake input (avoids GitHub API calls from the CLI) nix.registry.nixpkgs.flake = inputs.nixpkgs; + # Automated garbage collection and store hardlink deduplication + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 14d"; + }; + nix.optimise.automatic = true; + nixpkgs.config.allowUnfree = true; # ── Regional & locale settings ───────────────────────────────────────────────