From ddb041d08a6e198d9a25d2399f598bb7ebd0907d Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Tue, 16 Jan 2024 15:41:58 +0100 Subject: [PATCH] feat: automatic garbage collection --- modules/base.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/base.nix b/modules/base.nix index 8f9f6df..61d8f7c 100644 --- a/modules/base.nix +++ b/modules/base.nix @@ -83,7 +83,12 @@ nix.gc = { automatic = true; dates = "weekly"; - options = "--delete-older-than 7d"; + # Options given to nix-collect-garbage. + # They are documented here: https://nixos.org/manual/nix/stable/command-ref/nix-collect-garbage + # The `--delete-older-than `: https://nixos.org/manual/nix/stable/command-ref/nix-env/delete-generations#generations-time + # There, two meanings of are described. The second one is: + # +: Keep the last number generations, along with any newer than current. + options = "--delete-older-than +7"; }; # Delete all files in /tmp during boot.