From 8ea03f0a66e8083029c4628fdc28f860511e72e4 Mon Sep 17 00:00:00 2001 From: Hektor Misplon Date: Sat, 17 Jan 2026 20:00:21 +0100 Subject: [PATCH] feat: automate optimising store, garbage collection and upgrades --- modules/common/default.nix | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/modules/common/default.nix b/modules/common/default.nix index 8084f24..0fa09cc 100644 --- a/modules/common/default.nix +++ b/modules/common/default.nix @@ -22,4 +22,29 @@ inherit inputs outputs; }; }; + + nix.optimise = { + automatic = true; + dates = [ "05:00" ]; + }; + + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; + }; + + system.autoUpgrade = { + enable = true; + flake = inputs.self.outPath; + operation = "switch"; + flags = [ + "--recreate-lock-file" + "--commit-lock-file" + "--print-build-logs" + ]; + dates = "05:00"; + randomizedDelaySec = "45min"; + allowReboot = false; + }; }