diff options
author | John Ericson <Ericson2314@Yahoo.com> | 2017-05-21 13:39:23 -0400 |
---|---|---|
committer | John Ericson <Ericson2314@Yahoo.com> | 2017-05-22 00:25:02 -0400 |
commit | 2e7ec6fb702be66389405d48693b322565b27c69 (patch) | |
tree | 8fe252b2e58b2c7640f6c76d67707e5dc0bd9926 /lib/systems/doubles.nix | |
parent | da8b2f1412c77ef50c90587d4b0f3a66e11892d6 (diff) |
lib: Make platform predicates more ergonomic to use
`hostPlatform.isDarwin` instead of `lib.system.parse.isDarwin
hostPlatform.parsed`
Diffstat (limited to 'lib/systems/doubles.nix')
-rw-r--r-- | lib/systems/doubles.nix | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/lib/systems/doubles.nix b/lib/systems/doubles.nix index 9b17a51531a3..0168eb42f2f7 100644 --- a/lib/systems/doubles.nix +++ b/lib/systems/doubles.nix @@ -1,8 +1,9 @@ -let lists = import ../lists.nix; in -let parse = import ./parse.nix; in -let inherit (import ../attrsets.nix) matchAttrs; in - let + lists = import ../lists.nix; + parse = import ./parse.nix; + inherit (import ./inspect.nix) predicates; + inherit (import ../attrsets.nix) matchAttrs; + all = [ "aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7l-linux" @@ -25,20 +26,21 @@ in rec { allBut = platforms: lists.filter (x: !(builtins.elem x platforms)) all; none = []; - arm = filterDoubles (matchAttrs { cpu = { family = "arm"; bits = 32; }; }); - i686 = filterDoubles parse.isi686; - mips = filterDoubles (matchAttrs { cpu = { family = "mips"; }; }); - x86_64 = filterDoubles parse.isx86_64; - - cygwin = filterDoubles parse.isCygwin; - darwin = filterDoubles parse.isDarwin; - freebsd = filterDoubles (matchAttrs { kernel = parse.kernels.freebsd; }); - gnu = filterDoubles (matchAttrs { kernel = parse.kernels.linux; abi = parse.abis.gnu; }); # Should be better - illumos = filterDoubles (matchAttrs { kernel = parse.kernels.solaris; }); - linux = filterDoubles parse.isLinux; - netbsd = filterDoubles (matchAttrs { kernel = parse.kernels.netbsd; }); - openbsd = filterDoubles (matchAttrs { kernel = parse.kernels.openbsd; }); - unix = filterDoubles parse.isUnix; + arm = filterDoubles predicates.isArm32; + i686 = filterDoubles predicates.isi686; + mips = filterDoubles predicates.isMips; + x86_64 = filterDoubles predicates.isx86_64; + + cygwin = filterDoubles predicates.isCygwin; + darwin = filterDoubles predicates.isDarwin; + freebsd = filterDoubles predicates.isFreeBSD; + # Should be better, but MinGW is unclear, and HURD is bit-rotted. + gnu = filterDoubles (matchAttrs { kernel = parse.kernels.linux; abi = parse.abis.gnu; }); + illumos = filterDoubles predicates.isSunOS; + linux = filterDoubles predicates.isLinux; + netbsd = filterDoubles predicates.isNetBSD; + openbsd = filterDoubles predicates.isOpenBSD; + unix = filterDoubles predicates.isUnix; mesaPlatforms = ["i686-linux" "x86_64-linux" "x86_64-darwin" "armv5tel-linux" "armv6l-linux" "armv7l-linux" "aarch64-linux"]; } |