diff --git a/hosts/common/core/nix.nix b/hosts/common/core/nix.nix index 122ae30..dbc6fa6 100644 --- a/hosts/common/core/nix.nix +++ b/hosts/common/core/nix.nix @@ -8,7 +8,6 @@ { nix = { settings = { - auto-optimise-store = true; experimental-features = ["nix-command" "flakes"]; warn-dirty = false; @@ -23,6 +22,12 @@ ]; }; + optimise.automatic = true; + # optimise every Monday morning + # customized in hosts/common/darwin/nix.nix + # and hosts/common/nixos/nix.nix + + gc = { automatic = true; diff --git a/hosts/common/darwin/nix.nix b/hosts/common/darwin/nix.nix index a27ad9a..d31e0f5 100644 --- a/hosts/common/darwin/nix.nix +++ b/hosts/common/darwin/nix.nix @@ -2,6 +2,12 @@ nix.settings.extra-platforms = ["x86_64-darwin" "aarch64-darwin"]; services.nix-daemon.enable = true; + nix.optimise.interval = [{ + Hour = 4; + Minute = 15; + Weekday = 1; + }]; + nix.gc.interval = [{ Hour = 3; Minute = 15; diff --git a/hosts/common/nixos/nix.nix b/hosts/common/nixos/nix.nix index d7e1023..eaaa214 100644 --- a/hosts/common/nixos/nix.nix +++ b/hosts/common/nixos/nix.nix @@ -1,4 +1,5 @@ { ... }: { + nix.optimise.dates = [ "Mon *-*-* 04:15:00" ]; nix.gc.dates = "Mon *-*-* 03:15:00"; }