From db7738e67a101ad945abbcb447e1310147afaf1b Mon Sep 17 00:00:00 2001 From: fazzi <18248986+fxzzi@users.noreply.github.com> Date: Tue, 15 Apr 2025 17:49:11 +0100 Subject: [PATCH] nh: remove incorrect warning on gc conflicts (#6802) From what I understand, the warning removed in this PR was incorrect. There shouldn't be any conflict between osConfig.nix.gc and programs.nh.clean as our home-manager service only cleans user profiles (which nix-collect-garbage does not do). In this scenario they should both work at the same time as they are cleaning two different things. --- modules/programs/nh.nix | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/modules/programs/nh.nix b/modules/programs/nh.nix index ff4fc55b..f660e7bd 100644 --- a/modules/programs/nh.nix +++ b/modules/programs/nh.nix @@ -1,15 +1,11 @@ { config, - osConfig, lib, pkgs, ... }: - let - cfg = config.programs.nh; - in { meta.maintainers = with lib.maintainers; [ johnrtitor ]; @@ -60,12 +56,8 @@ in config = { warnings = - (lib.optional (cfg.clean.enable && osConfig != null && osConfig.nix.gc.automatic) - "programs.nh.clean.enable and nix.gc.automatic (system-wide in configuration.nix) are both enabled. Please use one or the other to avoid conflict." - ) - ++ (lib.optional (cfg.clean.enable && config.nix.gc.automatic) - "programs.nh.clean.enable and nix.gc.automatic (Home-Manager) are both enabled. Please use one or the other to avoid conflict." - ); + lib.optional (cfg.clean.enable && config.nix.gc.automatic) + "programs.nh.clean.enable and nix.gc.automatic (Home-Manager) are both enabled. Please use one or the other to avoid conflict."; home = lib.mkIf cfg.enable { packages = [ cfg.package ];