From 5d663a9171a1da65f6ff5fce0807cccbb697d06d Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Thu, 27 Oct 2022 13:41:01 +0200 Subject: [PATCH] nixos/nixpkgs.nix: Fix assertion when nixpkgs.pkgs is set --- nixos/modules/misc/nixpkgs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/misc/nixpkgs.nix b/nixos/modules/misc/nixpkgs.nix index 5bd7eb1408b2..00460a88d86c 100644 --- a/nixos/modules/misc/nixpkgs.nix +++ b/nixos/modules/misc/nixpkgs.nix @@ -358,7 +358,7 @@ in else "nixpkgs.localSystem"; pkgsSystem = finalPkgs.stdenv.targetPlatform.system; in { - assertion = !hasPlatform -> nixosExpectedSystem == pkgsSystem; + assertion = constructedByMe -> !hasPlatform -> nixosExpectedSystem == pkgsSystem; message = "The NixOS nixpkgs.pkgs option was set to a Nixpkgs invocation that compiles to target system ${pkgsSystem} but NixOS was configured for system ${nixosExpectedSystem} via NixOS option ${nixosOption}. The NixOS system settings must match the Nixpkgs target system."; } )