diff --git a/home/roles/base-darwin/default.nix b/home/roles/base-darwin/default.nix index 1b89696..cc2503d 100644 --- a/home/roles/base-darwin/default.nix +++ b/home/roles/base-darwin/default.nix @@ -4,4 +4,8 @@ imports = [ ../aerospace ]; + + # Override to use -d instead of --delete-older-than on Darwin due to launchd bug + # https://github.com/nix-community/home-manager/issues/7211 + nix.gc.options = "-d"; } diff --git a/home/roles/base/default.nix b/home/roles/base/default.nix index d529a8d..31adcae 100644 --- a/home/roles/base/default.nix +++ b/home/roles/base/default.nix @@ -24,6 +24,17 @@ in tree ]; + # Automatic garbage collection for user profile (home-manager generations). + # This complements system-level gc which only cleans system generations. + # - Linux: Uses --delete-older-than to keep 10-day rollback window + # - Darwin: Overridden to use -d in base-darwin role to avoid launchd bug + # (https://github.com/nix-community/home-manager/issues/7211) + nix.gc = { + automatic = true; + randomizedDelaySec = mkIf pkgs.stdenv.isLinux "14m"; + options = "--delete-older-than 10d"; + }; + # Essential programs everyone needs programs.bash = { enable = true;