feat: automatic garbage collection

This commit is contained in:
Daniel Langbein 2024-01-16 15:41:58 +01:00
parent 375378334a
commit ddb041d08a
Signed by: langfingaz
GPG Key ID: 6C47C753F0823002

View File

@ -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 <period` option refers the manual for `nix-env --delete-generations <period>`: https://nixos.org/manual/nix/stable/command-ref/nix-env/delete-generations#generations-time
# There, two meanings of <period> are described. The second one is:
# +<number>: Keep the last number generations, along with any newer than current.
options = "--delete-older-than +7";
};
# Delete all files in /tmp during boot.