From 10e0484f162f067712e04b12836e934469a2ddc7 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Tue, 17 Sep 2024 02:15:08 -0700 Subject: [PATCH] feat: add nix store optimization and gc options --- modules/linux/core/default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/linux/core/default.nix b/modules/linux/core/default.nix index 5de3c26..0ce228c 100644 --- a/modules/linux/core/default.nix +++ b/modules/linux/core/default.nix @@ -28,5 +28,16 @@ "nix-command" "flakes" ]; + optimise.automatic = true; + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 14d"; + }; + # Free up to 1GiB when there is less than 100MiB left + extraOptions = '' + min-free = ${toString (100 * 1024 * 1024)} + max-free = ${toString (1024 * 1024 * 1024)} + ''; }; }