From 2e79bd9e00b2d6cfe4574f08d448e03d8fe2a689 Mon Sep 17 00:00:00 2001 From: Julian Mutter Date: Sat, 6 Dec 2025 09:21:30 +0100 Subject: [PATCH] nix: do not optimise store on build, but regularly --- hosts/common/global/nix.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hosts/common/global/nix.nix b/hosts/common/global/nix.nix index 062f4a8..ba9b547 100644 --- a/hosts/common/global/nix.nix +++ b/hosts/common/global/nix.nix @@ -2,7 +2,8 @@ lib, outputs, ... -}: { +}: +{ # Apply overlays nixpkgs = { # TODO: apply this to hm and nixos without duplicate code @@ -18,7 +19,9 @@ }; }; - nix.settings.auto-optimise-store = lib.mkDefault true; + # optimize at every build, slows down builds + # better to do optimise.automatic for regular optimising + # nix.settings.auto-optimise-store = lib.mkDefault true; nix.settings.experimental-features = [ "nix-command" "flakes" @@ -32,6 +35,10 @@ # Keep the last 3 generations options = "--delete-older-than +3"; }; + nix.optimise = { + automatic = true; + dates = [ "weekly" ]; # Optional; allows customizing optimisation schedule + }; programs.nix-ld.enable = true;