lib/filterPackages: filter by flake requirements
returns only non-broken derivations that support the system.
This commit is contained in:
parent
4f38a88191
commit
fb14e20249
|
@ -26,4 +26,13 @@ rec {
|
|||
});
|
||||
|
||||
concatAttrs = lib.fold (attr: sum: lib.recursiveUpdate sum attr) { };
|
||||
|
||||
# Filter out packages that support given system and follow flake check requirements
|
||||
filterPackages = system: packages:
|
||||
let
|
||||
# Everything that nix flake check requires for the packages output
|
||||
filter = (n: v: with v; let platforms = meta.hydraPlatforms or meta.platforms or [ ]; in
|
||||
lib.isDerivation v && !meta.broken && builtins.elem system platforms);
|
||||
in
|
||||
lib.filterAttrs filter packages;
|
||||
}
|
||||
|
|
|
@ -17,7 +17,8 @@ lib.makeExtensible (final:
|
|||
lists = callLibs ./lists.nix;
|
||||
strings = callLibs ./strings.nix;
|
||||
|
||||
inherit (attrs) mapFilterAttrs genAttrs' pathsToImportedAttrs concatAttrs;
|
||||
inherit (attrs) mapFilterAttrs genAttrs'
|
||||
pathsToImportedAttrs concatAttrs filterPackages;
|
||||
inherit (lists) pathsIn;
|
||||
inherit (strings) rgxToString;
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue