From ad3f4782ddfbfd7e3974bda4109d9c889163bde8 Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Mon, 18 Mar 2024 15:17:36 +0100 Subject: [PATCH] Limit number of saved generations to 10 --- modules/system/auto-gc.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/system/auto-gc.nix b/modules/system/auto-gc.nix index 8a420f0..819dff3 100644 --- a/modules/system/auto-gc.nix +++ b/modules/system/auto-gc.nix @@ -6,10 +6,12 @@ options.myConfig.auto-gc.enable = lib.mkEnableOption ""; config = lib.mkIf config.myConfig.auto-gc.enable { - nix.gc = { - automatic = true; + myConfig.nix-helper.enable = true; + + nh.clean = { + enable = true; dates = "weekly"; - options = "--delete-older-than 7d"; + extraArgs = "--keep-since 7d --keep 10"; }; }; }