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 ; {
2
11
os = if isLinux then "Linux" else
3
12
if isWindows then "Windows" else
4
- if isDarwin then "Osx" else
13
+ if isDarwin then "Osx" else
5
14
if isFreeBSD then "Freebsd" else
6
15
if isOpenBSD then "Openbsd" else
7
16
if isNetBSD then "Netbsd" else
8
17
if isHurd then "Hurd" else
9
18
if isiOS then "Ios" else
10
19
if isAndroid then "Android" else
20
+ if isGhcjs then "Ghcjs" else
21
+ if isAsterius then "Asterius" else
11
22
throw "Unknown OS" ;
12
23
arch = if isx86 && is32bit then "I386" else
13
24
if isx86 && is64bit then "X86_64" else
@@ -16,5 +27,8 @@ stdenv: with stdenv.hostPlatform; {
16
27
if isAarch32 then "Arm" else
17
28
if isAarch64 then "Aarch64" else
18
29
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
19
33
throw "Unknown Arch" ;
20
34
}
0 commit comments