mirror of
https://github.com/numtide/flake-utils.git
synced 2024-12-14 11:47:31 +00:00
Merge pull request #74 from sigprof/filter-packages
Fix `filterPackages` to match platform filtering done by Nixpkgs
This commit is contained in:
commit
bee6a7250d
1 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue