diff options
author | Frederik Rietdijk <freddyrietdijk@fridh.nl> | 2019-03-01 09:22:21 +0100 |
---|---|---|
committer | Frederik Rietdijk <freddyrietdijk@fridh.nl> | 2019-03-01 09:22:21 +0100 |
commit | 205e0fc5bd49dcd21c14083246610f608e7b50c6 (patch) | |
tree | b3c621ab8ea0f89f5dc4ea8c4bae5b8e7fbc90cf /lib/systems/default.nix | |
parent | 6d61a0b312f9277debf88a9f85feef5fd313f3d4 (diff) | |
parent | 3c77acbcd50156d300011e7a826dfcd41403e3f3 (diff) |
Merge staging-next into staging
Diffstat (limited to 'lib/systems/default.nix')
-rw-r--r-- | lib/systems/default.nix | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/systems/default.nix b/lib/systems/default.nix index 6e83546ae8e7b..090a3f700d4cc 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -24,6 +24,8 @@ rec { config = parse.tripleFromSystem final.parsed; # Just a guess, based on `system` platform = platforms.selectBySystem final.system; + # Determine whether we are compatible with the provided CPU + isCompatible = platform: parse.isCompatible final.parsed.cpu platform.parsed.cpu; # Derived meta-data libc = /**/ if final.isDarwin then "libSystem" @@ -99,13 +101,14 @@ rec { wine = (pkgs.winePackagesFor wine-name).minimal; in if final.parsed.kernel.name == pkgs.stdenv.hostPlatform.parsed.kernel.name && - (final.parsed.cpu.name == pkgs.stdenv.hostPlatform.parsed.cpu.name || - (final.isi686 && pkgs.stdenv.hostPlatform.isx86_64)) - then pkgs.runtimeShell + pkgs.stdenv.hostPlatform.isCompatible final + then "${pkgs.runtimeShell} -c" else if final.isWindows then "${wine}/bin/${wine-name}" else if final.isLinux && pkgs.stdenv.hostPlatform.isLinux then "${qemu-user}/bin/qemu-${final.qemuArch}" + else if final.isWasm + then "${pkgs.v8}/bin/d8" else throw "Don't know how to run ${final.config} executables."; } // mapAttrs (n: v: v final.parsed) inspect.predicates |