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
+1 -1
View File
@@ -14,7 +14,7 @@ let
mkWith = mkFlag "with-" "without-";
mkOther = mkFlag "" "" true;
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;
optPam = shouldUsePkg pam;
optLibidn = shouldUsePkg libidn;