summary refs log tree commit diff
path: root/pkgs/top-level/stage.nix
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2018-10-14 00:26:09 -0500
committerMatthew Bauer <mjbauer95@gmail.com>2018-10-15 12:59:07 -0500
commit01dfe3f56019b0c330bc2e46da90146698844330 (patch)
tree625fd9ee4c462e7151c47290802ff4363064c67a /pkgs/top-level/stage.nix
parent81593e39bce611c390d1b7954633b9ddab58f4c8 (diff)
downloadnixpkgs-01dfe3f56019b0c330bc2e46da90146698844330.tar
nixpkgs-01dfe3f56019b0c330bc2e46da90146698844330.tar.gz
nixpkgs-01dfe3f56019b0c330bc2e46da90146698844330.tar.bz2
nixpkgs-01dfe3f56019b0c330bc2e46da90146698844330.tar.lz
nixpkgs-01dfe3f56019b0c330bc2e46da90146698844330.tar.xz
nixpkgs-01dfe3f56019b0c330bc2e46da90146698844330.tar.zst
nixpkgs-01dfe3f56019b0c330bc2e46da90146698844330.zip
stage.nix: fix cross compiling with pkgsMusl
Fixes #48265
Diffstat (limited to 'pkgs/top-level/stage.nix')
-rw-r--r--pkgs/top-level/stage.nix11
1 files changed, 8 insertions, 3 deletions
diff --git a/pkgs/top-level/stage.nix b/pkgs/top-level/stage.nix
index 7637371a40f..d0fb885dc74 100644
--- a/pkgs/top-level/stage.nix
+++ b/pkgs/top-level/stage.nix
@@ -134,13 +134,16 @@ let
     # default GNU libc on Linux systems. Non-Linux systems are not
     # supported.
     pkgsMusl = if stdenv.hostPlatform.isLinux then nixpkgsFun {
-      localSystem = {
+      inherit overlays config;
+      ${if stdenv.hostPlatform == stdenv.buildPlatform
+        then "localSystem" else "crossSystem"} = {
         parsed = stdenv.hostPlatform.parsed // {
           abi = {
             "gnu" = lib.systems.parse.abis.musl;
             "gnueabi" = lib.systems.parse.abis.musleabi;
             "gnueabihf" = lib.systems.parse.abis.musleabihf;
-          }.${stdenv.hostPlatform.parsed.abi.name} or lib.systems.parse.abis.musl;
+          }.${stdenv.hostPlatform.parsed.abi.name}
+            or lib.systems.parse.abis.musl;
         };
       };
     } else throw "Musl libc only supports Linux systems.";
@@ -148,7 +151,9 @@ let
     # All packages built for i686 Linux.
     # Used by wine, firefox with debugging version of Flash, ...
     pkgsi686Linux = assert stdenv.hostPlatform.isLinux; nixpkgsFun {
-      localSystem = {
+      inherit overlays config;
+      ${if stdenv.hostPlatform == stdenv.buildPlatform
+        then "localSystem" else "crossSystem"} = {
         parsed = stdenv.hostPlatform.parsed // {
           cpu = lib.systems.parse.cpuTypes.i686;
         };