summaryrefslogtreecommitdiffstats
path: root/lib/systems/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'lib/systems/default.nix')
-rw-r--r--lib/systems/default.nix21
1 files changed, 15 insertions, 6 deletions
diff --git a/lib/systems/default.nix b/lib/systems/default.nix
index 4edcbeb36f16..1bbe976c4d21 100644
--- a/lib/systems/default.nix
+++ b/lib/systems/default.nix
@@ -24,8 +24,6 @@ rec {
# Either of these can be losslessly-extracted from `parsed` iff parsing succeeds.
system = parse.doubleFromSystem final.parsed;
config = parse.tripleFromSystem final.parsed;
- # Just a guess, based on `system`
- platform = platforms.select final;
# Determine whether we are compatible with the provided CPU
isCompatible = platform: parse.isCompatible final.parsed.cpu platform.parsed.cpu;
# Derived meta-data
@@ -79,12 +77,23 @@ rec {
};
isStatic = final.isWasm || final.isRedox;
- kernelArch =
+ # Just a guess, based on `system`
+ inherit
+ ({
+ linux-kernel = args.linux-kernel or {};
+ gcc = args.gcc or {};
+ rustc = args.rust or {};
+ } // platforms.select final)
+ linux-kernel gcc rustc;
+
+ linuxArch =
if final.isAarch32 then "arm"
else if final.isAarch64 then "arm64"
- else if final.isx86_32 then "x86"
- else if final.isx86_64 then "x86"
+ else if final.isx86_32 then "i386"
+ else if final.isx86_64 then "x86_64"
else if final.isMips then "mips"
+ else if final.isPower then "powerpc"
+ else if final.isRiscV then "riscv"
else final.parsed.cpu.name;
qemuArch =
@@ -129,7 +138,7 @@ rec {
else throw "Don't know how to run ${final.config} executables.";
} // mapAttrs (n: v: v final.parsed) inspect.predicates
- // mapAttrs (n: v: v final.platform.gcc.arch or "default") architectures.predicates
+ // mapAttrs (n: v: v final.gcc.arch or "default") architectures.predicates
// args;
in assert final.useAndroidPrebuilt -> final.isAndroid;
assert lib.foldl