fix native hosts to not build as cross
This commit is contained in:
@@ -12,7 +12,7 @@ in
|
|||||||
final: prev:
|
final: prev:
|
||||||
let
|
let
|
||||||
optional = cond: overlay: if cond then overlay else (_: _: {});
|
optional = cond: overlay: if cond then overlay else (_: _: {});
|
||||||
isCross = prev.stdenv.hostPlatform != prev.stdenv.buildPlatform;
|
isCross = !(prev.lib.systems.equals prev.stdenv.hostPlatform prev.stdenv.buildPlatform);
|
||||||
# isCross = !(prev.stdenv.buildPlatform.canExecute prev.stdenv.hostPlatform);
|
# isCross = !(prev.stdenv.buildPlatform.canExecute prev.stdenv.hostPlatform);
|
||||||
isStatic = prev.stdenv.hostPlatform.isStatic;
|
isStatic = prev.stdenv.hostPlatform.isStatic;
|
||||||
renderOverlays = overlays: builtins.foldl'
|
renderOverlays = overlays: builtins.foldl'
|
||||||
|
@@ -142,6 +142,9 @@ let
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
elaborate = unpatchedNixpkgs.lib.systems.elaborate;
|
||||||
|
isCross = !(unpatchedNixpkgs.lib.systems.equals (elaborate system) (elaborate localSystem));
|
||||||
|
|
||||||
nativeNixpkgsArgs = commonNixpkgsArgs // {
|
nativeNixpkgsArgs = commonNixpkgsArgs // {
|
||||||
config = {
|
config = {
|
||||||
allowUnfree = true; # NIXPKGS_ALLOW_UNFREE=1
|
allowUnfree = true; # NIXPKGS_ALLOW_UNFREE=1
|
||||||
@@ -149,7 +152,7 @@ let
|
|||||||
allowUnsupportedSystem = true; # NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1
|
allowUnsupportedSystem = true; # NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
nixpkgsArgs = nativeNixpkgsArgs // optionalAttrs (system != localSystem) {
|
nixpkgsArgs = nativeNixpkgsArgs // optionalAttrs isCross {
|
||||||
# XXX(2023/12/11): cache.nixos.org uses `system = ...` instead of `hostPlatform.system`, and that choice impacts the closure of every package.
|
# XXX(2023/12/11): cache.nixos.org uses `system = ...` instead of `hostPlatform.system`, and that choice impacts the closure of every package.
|
||||||
# so avoid specifying hostPlatform.system on non-cross builds, so i can use upstream caches.
|
# so avoid specifying hostPlatform.system on non-cross builds, so i can use upstream caches.
|
||||||
crossSystem = system;
|
crossSystem = system;
|
||||||
|
Reference in New Issue
Block a user