diff --git a/lib/systems/default.nix b/lib/systems/default.nix index 8eeab67f7f33..b45a5fd8d2ba 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" diff --git a/pkgs/os-specific/linux/kernel-headers/default.nix b/pkgs/os-specific/linux/kernel-headers/default.nix index c00fc1761d59..ea4e041d43a0 100644 --- a/pkgs/os-specific/linux/kernel-headers/default.nix +++ b/pkgs/os-specific/linux/kernel-headers/default.nix @@ -12,7 +12,7 @@ let inherit sha256; }; - ARCH = stdenvNoCC.hostPlatform.platform.kernelArch or (throw "missing kernelArch"); + ARCH = stdenvNoCC.hostPlatform.platform.kernelArch or stdenvNoCC.hostPlatform.kernelArch; # It may look odd that we use `stdenvNoCC`, and yet explicit depend on a cc. # We do this so we have a build->build, not build->host, C compiler.