From 80ac00a7cfe9610c709fc0fdc9bdc996e795b0de Mon Sep 17 00:00:00 2001 From: Gabe Venberg Date: Mon, 6 May 2024 19:05:40 -0500 Subject: [PATCH] added storage optimization settings to optimise and gc the nix store. --- modules/home-manager/default.nix | 12 +++++++++--- modules/nixos/common.nix | 9 +++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index c1fe84a..41d3d37 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -14,9 +14,15 @@ lib.mkIf config.targets.genericLinux.enable { package = pkgs.nix; - settings.experimental-features = ["nix-command" "flakes"]; - settings.max-jobs = "auto"; - gc.automatic = true; + settings = { + experimental-features = ["nix-command" "flakes"]; + max-jobs = "auto"; + }; + gc = { + automatic = true; + frequency = "weekly"; + options = "--delete-older-than 30d"; + }; }; imports = [ ../hostopts.nix diff --git a/modules/nixos/common.nix b/modules/nixos/common.nix index bc5077b..80fd949 100644 --- a/modules/nixos/common.nix +++ b/modules/nixos/common.nix @@ -13,6 +13,15 @@ extraOptions = '' experimental-features = nix-command flakes ''; + optimise.automatic = true; + settings = { + auto-optimise-store = true; + }; + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; + }; }; # Allow unfree packages