mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-27 22:03:54 +03:00
impure.nix: fix handling of localSystem
If we passed a localSystem in, we don’t want the current system to override it. Now we check for localSystem first to avoid getting "mixed" localSystem values from commands like this: nix-build --arg localSystem '{config="x86_64-unknown-linux-musl";}' -A hello Which would eventually evaluate localSystem to this: { config = "x86_64-unknown-linux-musl"; system = "x86_64-darwin"; } & Nix would not be able to run it correctly. Fixes #41599 /cc @Ericson2314
This commit is contained in:
parent
5000cc555e
commit
31eac6fd00
@ -83,5 +83,6 @@ import ./. (builtins.removeAttrs args [ "system" "platform" ] // {
|
||||
inherit config overlays crossSystem;
|
||||
# Fallback: Assume we are building packages on the current (build, in GNU
|
||||
# Autotools parlance) system.
|
||||
localSystem = { system = builtins.currentSystem; } // localSystem;
|
||||
localSystem = (if args ? localSystem then {}
|
||||
else { system = builtins.currentSystem; }) // localSystem;
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user