summary refs log tree commit diff
path: root/lib/systems/default.nix
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2019-04-19 14:51:25 -0400
committerMatthew Bauer <mjbauer95@gmail.com>2019-04-19 14:53:48 -0400
commitd8934feba1399d220550b81dceeb6da35149cf02 (patch)
tree19b3a7c12396f777311252a9ef83bcfdbde419e8 /lib/systems/default.nix
parent97a3c7f5a3a1d4dfd91dcf96664bc11a376bfd96 (diff)
downloadnixpkgs-d8934feba1399d220550b81dceeb6da35149cf02.tar
nixpkgs-d8934feba1399d220550b81dceeb6da35149cf02.tar.gz
nixpkgs-d8934feba1399d220550b81dceeb6da35149cf02.tar.bz2
nixpkgs-d8934feba1399d220550b81dceeb6da35149cf02.tar.lz
nixpkgs-d8934feba1399d220550b81dceeb6da35149cf02.tar.xz
nixpkgs-d8934feba1399d220550b81dceeb6da35149cf02.tar.zst
nixpkgs-d8934feba1399d220550b81dceeb6da35149cf02.zip
kernel-headers: infer ARCH from config triple
This makes us less reliant on the systems/examples.nix. You should be
able to cross compile with just your triple:

$ nix build --arg crossSystem '{ config = "armv6l-unknown-linux-gnueabi"; }' stdenv
Diffstat (limited to 'lib/systems/default.nix')
-rw-r--r--lib/systems/default.nix7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/systems/default.nix b/lib/systems/default.nix
index 8eeab67f7f3..b45a5fd8d2b 100644
--- a/lib/systems/default.nix
+++ b/lib/systems/default.nix
@@ -72,6 +72,13 @@ rec {
          release = null;
       };
 
+      kernelArch =
+        if final.isAarch32 then "arm"
+        else if final.isAarch64 then "arm64"
+        else if final.isx86_32 then "x86"
+        else if final.isx86_64 then "ia64"
+        else final.parsed.cpu.name;
+
       qemuArch =
         if final.isArm then "arm"
         else if final.isx86_64 then "x86_64"