Skip to content

Commit 6a870ca

Browse files
stackptrclaude
andcommitted
feat(base): add nix store garbage collection and boot entry limits
Configure automatic weekly GC across all platforms with --delete-older-than 30d. Limits systemd-boot entries to 10 on NixOS. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8947e65 commit 6a870ca

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

‎modules/base/default.nix‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Base configuration shared across all systems
22
{
33
imports = [
4+
./gc.nix
45
./nix-config.nix
56
./unfree-packages.nix
67
];

‎modules/base/gc.nix‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Nix store garbage collection and boot entry limits
2+
{
3+
lib,
4+
pkgs,
5+
...
6+
}: {
7+
nix.gc =
8+
{
9+
automatic = true;
10+
options = "--delete-older-than 30d";
11+
}
12+
// lib.optionalAttrs pkgs.stdenv.isLinux {
13+
dates = "weekly";
14+
}
15+
// lib.optionalAttrs pkgs.stdenv.isDarwin {
16+
interval = {Weekday = 0;};
17+
};
18+
19+
boot.loader.systemd-boot.configurationLimit = lib.mkIf pkgs.stdenv.isLinux 10;
20+
}

0 commit comments

Comments
 (0)