Merge pull request #198056 from hercules-ci/nixos-fix-nixpkgs-assertion-when-pkgs-is-set

This commit is contained in:
Bernardo Meurer 2022-10-27 12:58:11 +01:00 committed by GitHub
commit 948fd41c77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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.";
}
)