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.
This commit is contained in:
fazzi 2025-04-15 17:49:11 +01:00 committed by GitHub
parent 85c513aa86
commit db7738e67a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 ];