From caee7806be3f94bff03ec15d97eb57488a0737a3 Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Fri, 25 Oct 2024 14:42:29 -0600 Subject: [PATCH] nixpkgs-disabled: correct assertion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Should only pass if _both_ attributes are `null`. I recently found myself in a confusing situation when I added my usual `homeConfiguration` to a `nixosConfiguration` that had `home-manager.useGlobalPackages = true`. `nixos-rebuild` was just claiming that some attributes were missing from `pkgs`, rather than asserting that my `nixpkgs.overlays` was set when it couldn’t be. --- modules/misc/nixpkgs-disabled.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/misc/nixpkgs-disabled.nix b/modules/misc/nixpkgs-disabled.nix index ab0f35df7..09afc446e 100644 --- a/modules/misc/nixpkgs-disabled.nix +++ b/modules/misc/nixpkgs-disabled.nix @@ -64,7 +64,7 @@ in { config = { assertions = [{ - assertion = cfg.config == null || cfg.overlays == null; + assertion = cfg.config == null && cfg.overlays == null; message = '' `nixpkgs` options are disabled when `home-manager.useGlobalPkgs` is enabled. '';