mirror of
https://github.com/numtide/flake-utils.git
synced 2024-09-11 20:17:13 +03: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
@ -21,11 +21,13 @@ let
|
|||||||
inherit (builtins) isAttrs;
|
inherit (builtins) isAttrs;
|
||||||
isDerivation = x: isAttrs x && x ? type && x.type == "derivation";
|
isDerivation = x: isAttrs x && x ? type && x.type == "derivation";
|
||||||
isBroken = meta.broken or false;
|
isBroken = meta.broken or false;
|
||||||
platforms = meta.hydraPlatforms or meta.platforms or allSystems;
|
platforms = meta.platforms or allSystems;
|
||||||
|
badPlatforms = meta.badPlatforms or [ ];
|
||||||
in
|
in
|
||||||
# check for isDerivation, so this is independently useful of
|
# check for isDerivation, so this is independently useful of
|
||||||
# flattenTree, which also does filter on derviations
|
# flattenTree, which also does filter on derivations
|
||||||
isDerivation v && !isBroken && builtins.elem system platforms
|
isDerivation v && !isBroken && (builtins.elem system platforms) &&
|
||||||
|
!(builtins.elem system badPlatforms)
|
||||||
;
|
;
|
||||||
in
|
in
|
||||||
filterAttrs sieve packages
|
filterAttrs sieve packages
|
||||||
|
Loading…
Reference in New Issue
Block a user