From f96686128fc076b0b64bbc336b1e48b6c0d8d2c3 Mon Sep 17 00:00:00 2001 From: Aloys23 Date: Sat, 30 May 2026 16:06:38 +0800 Subject: [PATCH] add generation limit (10) and weekly garbage collection --- configuration.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configuration.nix b/configuration.nix index 69737c6..a5d4944 100644 --- a/configuration.nix +++ b/configuration.nix @@ -18,6 +18,7 @@ # ── 引导 ──────────────────────────────────────────────────── boot.loader.systemd-boot.enable = true; + boot.loader.systemd-boot.configurationLimit = 10; # 只保留最近 10 次迭代 boot.loader.efi.canTouchEfiVariables = true; # ── 网络 ──────────────────────────────────────────────────── @@ -138,6 +139,13 @@ ffmpeg ]; + # ── 自动清理旧的系统迭代 ──────────────────────────────────── + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 7d"; + }; + # ── 系统状态版本(请勿修改) ──────────────────────────────── system.stateVersion = "25.11"; }