Merge pull request #74 from sigprof/filter-packages

Fix `filterPackages` to match platform filtering done by Nixpkgs
This commit is contained in:
Jonas Chevalier 2022-06-24 12:05:34 +02:00 committed by GitHub
commit bee6a7250d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,11 +21,13 @@ let
inherit (builtins) isAttrs;
isDerivation = x: isAttrs x && x ? type && x.type == "derivation";
isBroken = meta.broken or false;
platforms = meta.hydraPlatforms or meta.platforms or allSystems;
platforms = 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
# flattenTree, which also does filter on derivations
isDerivation v && !isBroken && (builtins.elem system platforms) &&
!(builtins.elem system badPlatforms)
;
in
filterAttrs sieve packages