diff --git a/modules/programs/nh.nix b/modules/programs/nh.nix index cb3d85e506f7..7e6e993fddaa 100644 --- a/modules/programs/nh.nix +++ b/modules/programs/nh.nix @@ -52,15 +52,11 @@ in { }; config = { - warnings = lib.optionals - (osConfig != null && !(cfg.clean.enable -> !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." - ]; - - assertions = [{ - assertion = (cfg.flake != null) -> !(lib.hasSuffix ".nix" cfg.flake); - message = "nh.flake must be a directory, not a nix file"; - }]; + 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."); home = lib.mkIf cfg.enable { packages = [ cfg.package ];