about summary refs log tree commit diff
path: root/lib/systems/default.nix
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2019-02-21 22:17:51 -0500
committerMatthew Bauer <mjbauer95@gmail.com>2019-02-21 22:17:51 -0500
commitf455a07f13934285931c8bfc97fe10a3f0f3430d (patch)
tree1cc38e6a4d9109afd33b25e3eb8b5d97b1ccba7d /lib/systems/default.nix
parent266315c91d5e4a6d7b8465eb44d4f6af30d90b30 (diff)
systems: add isCompatible handling
Diffstat (limited to 'lib/systems/default.nix')
-rw-r--r--lib/systems/default.nix5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/systems/default.nix b/lib/systems/default.nix
index 77f200952958b..b24eb4245ff83 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"
@@ -98,8 +100,7 @@ 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))
+           pkgs.stdenv.hostPlatform.isCompatible final
         then pkgs.runtimeShell
         else if final.isWindows
         then "${wine}/bin/${wine-name}"