diff --git a/overlays/all.nix b/overlays/all.nix index 96683828e..815b9010e 100644 --- a/overlays/all.nix +++ b/overlays/all.nix @@ -12,7 +12,7 @@ in final: prev: let 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); isStatic = prev.stdenv.hostPlatform.isStatic; renderOverlays = overlays: builtins.foldl' diff --git a/pkgs/by-name/nixpkgs-bootstrap/mkNixpkgs.nix b/pkgs/by-name/nixpkgs-bootstrap/mkNixpkgs.nix index 2978e2e97..23eedbb56 100644 --- a/pkgs/by-name/nixpkgs-bootstrap/mkNixpkgs.nix +++ b/pkgs/by-name/nixpkgs-bootstrap/mkNixpkgs.nix @@ -142,6 +142,9 @@ let ''; }; + elaborate = unpatchedNixpkgs.lib.systems.elaborate; + isCross = !(unpatchedNixpkgs.lib.systems.equals (elaborate system) (elaborate localSystem)); + nativeNixpkgsArgs = commonNixpkgsArgs // { config = { allowUnfree = true; # NIXPKGS_ALLOW_UNFREE=1 @@ -149,7 +152,7 @@ let 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. # so avoid specifying hostPlatform.system on non-cross builds, so i can use upstream caches. crossSystem = system;