From 134d049a7b94e5eedc1608b817fc7f7e291d26cb Mon Sep 17 00:00:00 2001 From: min Date: Sat, 14 Dec 2024 19:39:24 -0500 Subject: [PATCH] Move nix gc+opt to global config --- nixos/hosts/silver/configuration.nix | 13 ------------- nixos/modules/default.nix | 11 +++++++++++ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/nixos/hosts/silver/configuration.nix b/nixos/hosts/silver/configuration.nix index c8befd8..d55500a 100644 --- a/nixos/hosts/silver/configuration.nix +++ b/nixos/hosts/silver/configuration.nix @@ -105,18 +105,5 @@ in { hostKeys = ["/persist/etc/secrets/initrd/ssh_host_ed25519_key"]; }; - # Periodically optimise & collect garbage - nix = { - gc = { - automatic = true; - dates = "daily"; - options = "--delete-older-than 30d"; - }; - optimise = { - automatic = true; - dates = ["daily"]; - }; - }; - system.stateVersion = "24.05"; } diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix index 7d83a7d..922a65e 100644 --- a/nixos/modules/default.nix +++ b/nixos/modules/default.nix @@ -29,6 +29,17 @@ ### Nix settings ### nix = { + # Periodically optimise & collect garbage + gc = { + automatic = true; + dates = "daily"; + options = "--delete-older-than 30d"; + }; + optimise = { + automatic = true; + dates = ["daily"]; + }; + # Make sure flakes are enabled settings.experimental-features = ["nix-command" "flakes"]; extraOptions = ''