filterPackages: Add support for meta.badPlatforms

Since https://www.github.com/NixOS/nixpkgs/pull/37803 Nixpkgs supports
using meta.badPlatforms to specify a list of platforms which are not
supported by the package despite being included in meta.platforms.
Modify filterPackages to honor these platform restrictions.
This commit is contained in:
Sergey Vlasov 2022-06-24 00:01:45 +03:00
parent 1ed9fb1935
commit 3ff4550a66

View File

@ -22,10 +22,12 @@ let
isDerivation = x: isAttrs x && x ? type && x.type == "derivation";
isBroken = meta.broken or false;
platforms = meta.hydraPlatforms or meta.platforms or allSystems;
badPlatforms = meta.badPlatforms or [ ];
in
# check for isDerivation, so this is independently useful of
# flattenTree, which also does filter on derviations
isDerivation v && !isBroken && builtins.elem system platforms
isDerivation v && !isBroken && (builtins.elem system platforms) &&
!(builtins.elem system badPlatforms)
;
in
filterAttrs sieve packages