From 27408723d9650376776c066084a9f52ffd62fd08 Mon Sep 17 00:00:00 2001 From: Yan Lin Date: Sat, 25 Oct 2025 14:58:02 +0200 Subject: [PATCH] add automatic garbage collect to vps host --- hosts/nixos/vps/system.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/hosts/nixos/vps/system.nix b/hosts/nixos/vps/system.nix index e302562..c1659d5 100644 --- a/hosts/nixos/vps/system.nix +++ b/hosts/nixos/vps/system.nix @@ -17,6 +17,20 @@ device = "nodev"; # Required for EFI systems efiSupport = true; efiInstallAsRemovable = true; # Better compatibility with VPS + configurationLimit = 5; # Keep only 5 boot entries to save storage + }; + + # Automatic garbage collection to save storage + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 7d"; + }; + + # Automatic store optimization to deduplicate files + nix.optimise = { + automatic = true; + dates = [ "weekly" ]; }; # Network configuration