From 4d1e79ac39037278d865994103ecbff60955bb50 Mon Sep 17 00:00:00 2001 From: phartman Date: Fri, 17 Jan 2025 00:11:13 -0600 Subject: [PATCH] Enabling garbage collection and Nix Store Optimazation --- hosts/latitude/configuration.nix | 12 +++++++++--- hosts/legion/configuration.nix | 8 ++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/hosts/latitude/configuration.nix b/hosts/latitude/configuration.nix index 26b4232..659ca75 100644 --- a/hosts/latitude/configuration.nix +++ b/hosts/latitude/configuration.nix @@ -335,9 +335,15 @@ fileSystems."/mnt/nas/tvshows" = { # Enable Automatic Upgrades system.autoUpgrade.enable = true; - nix.gc.automatic = true; - nix.gc.dates = "weekly"; # Run garbage collection weekly to free up disk space - + + # Garbage Collection and Store Optimization + nix.settings.auto-optimise-store = true; + nix.gc = { + automatic = true; + interval = { Weekday = 0; Hour = 0; Minute = 0; }; + options = "--delete-older-than 30d"; + }; + # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave diff --git a/hosts/legion/configuration.nix b/hosts/legion/configuration.nix index 68d042f..2300984 100644 --- a/hosts/legion/configuration.nix +++ b/hosts/legion/configuration.nix @@ -505,6 +505,14 @@ fileSystems."/mnt/nas/tvshows" = { persistent = true; }; + # Garbage Collection and Store Optimization + nix.settings.auto-optimise-store = true; + nix.gc = { + automatic = true; + interval = { Weekday = 0; Hour = 0; Minute = 0; }; + options = "--delete-older-than 30d"; + }; + # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave