lib.meta: introduce availableOn

This commit is contained in:
oxalica
2021-04-02 19:20:23 +08:00
parent 905ecb920e
commit 354d262db8
14 changed files with 27 additions and 15 deletions
@@ -14,7 +14,7 @@ let
mkEnable = mkFlag "enable-" "disable-";
mkWith = mkFlag "with-" "without-";
shouldUsePkg = pkg: if pkg != null && lib.any (lib.meta.platformMatch stdenv.hostPlatform) pkg.meta.platforms then pkg else null;
shouldUsePkg = pkg: if pkg != null && lib.meta.availableOn stdenv.hostPlatform pkg then pkg else null;
optLz4 = shouldUsePkg lz4;
optSnappy = shouldUsePkg snappy;