@ -18,6 +18,7 @@
with lib . lists ;
with lib . types ;
with lib . attrsets ;
with lib . strings ;
with ( import ./inspect.nix { inherit lib ; } ) . predicates ;
let
@ -179,9 +180,6 @@ rec {
} // { # aliases
# 'darwin' is the kernel for all of them. We choose macOS by default.
darwin = kernels . macos ;
# TODO(@Ericson2314): Handle these Darwin version suffixes more generally.
darwin10 = kernels . macos ;
darwin14 = kernels . macos ;
watchos = kernels . ios ;
tvos = kernels . ios ;
win32 = kernels . windows ;
@ -269,6 +267,8 @@ rec {
then { cpu = elemAt l 0 ; kernel = elemAt l 1 ; abi = elemAt l 2 ; }
else if ( elemAt l 2 == " m i n g w 3 2 " ) # autotools breaks on -gnu for window
then { cpu = elemAt l 0 ; vendor = elemAt l 1 ; kernel = " w i n d o w s " ; abi = " g n u " ; }
else if hasPrefix " n e t b s d " ( elemAt l 2 )
then { cpu = elemAt l 0 ; vendor = elemAt l 1 ; kernel = elemAt l 2 ; }
else throw " T a r g e t s p e c i f i c a t i o n w i t h 3 c o m p o n e n t s i s a m b i g u o u s " ;
" 4 " = { cpu = elemAt l 0 ; vendor = elemAt l 1 ; kernel = elemAt l 2 ; abi = elemAt l 3 ; } ;
} . ${ toString ( length l ) }
@ -295,7 +295,9 @@ rec {
else if isDarwin parsed then vendors . apple
else if isWindows parsed then vendors . pc
else vendors . unknown ;
kernel = getKernel args . kernel ;
kernel = if hasPrefix " d a r w i n " args . kernel then getKernel " d a r w i n "
else if hasPrefix " n e t b s d " args . kernel then getKernel " n e t b s d "
else getKernel args . kernel ;
abi =
/* */ if args ? abi then getAbi args . abi
else if isLinux parsed then