@@ -1,13 +1,24 @@
1−stdenv: with stdenv.hostPlatform; {
1+stdenv:
2+# set a few default values so we don't depend on what's exported from
3+# hostPlatform from whatever nixpkgs set we are working against.
4+with { isLinux = false; isWindows = false; isDarwin = false; isFreeBSD = false;
5+ isOpenBSD = false; isNetBSD = false; isiOS = false; isAndroid = false;
6+ isGhcjs = false; isAsterius = false; isHurd = false;
7+ isx86 = false; isPowerPC = false; isAarch32 = false; isAarch64 = false;
8+ isMips = false; isWasm = false; isJavaScript = false;
9+ is32bit = false; is64bit = false; };
10+with stdenv.hostPlatform; {
211 os = if isLinux then "Linux" else
312 if isWindows then "Windows" else
4− if isDarwin then "Osx" else
13+ if isDarwin then "Osx" else
514 if isFreeBSD then "Freebsd" else
615 if isOpenBSD then "Openbsd" else
716 if isNetBSD then "Netbsd" else
817 if isHurd then "Hurd" else
918 if isiOS then "Ios" else
1019 if isAndroid then "Android" else
20+ if isGhcjs then "Ghcjs" else
21+ if isAsterius then "Asterius" else
1122 throw "Unknown OS";
1223 arch = if isx86 && is32bit then "I386" else
1324 if isx86 && is64bit then "X86_64" else
@@ -16,5 +27,8 @@ stdenv: with stdenv.hostPlatform; {
1627 if isAarch32 then "Arm" else
1728 if isAarch64 then "Aarch64" else
1829 if isMips then "Mips" else
30+ if isWasm && is32bit then "Wasm32" else
31+ if isWasm && is64bit then "Wasm64" else
32+ if isJavaScript then "JavaScript" else
1933 throw "Unknown Arch";
2034}