filterPackages: add fallbacks for missing attrs (#32)
Co-authored-by: Pacman99 <pachum99@gmail.com>
This commit is contained in:
parent
2ebf2558e5
commit
b543720b25
|
@ -119,7 +119,7 @@ let
|
||||||
# {
|
# {
|
||||||
# hello = «derivation»;
|
# hello = «derivation»;
|
||||||
# }
|
# }
|
||||||
filterPackages = system: packages: import ./filterPackages.nix system packages;
|
filterPackages = import ./filterPackages.nix { inherit allSystems; };
|
||||||
|
|
||||||
# Returns the structure used by `nix app`
|
# Returns the structure used by `nix app`
|
||||||
mkApp =
|
mkApp =
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
{ allSystems }:
|
||||||
system: packages:
|
system: packages:
|
||||||
let
|
let
|
||||||
# Adopted from nixpkgs.lib
|
# Adopted from nixpkgs.lib
|
||||||
|
@ -18,11 +19,12 @@ let
|
||||||
let
|
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";
|
||||||
platforms = meta.hydraPlatforms or meta.platforms or [ ];
|
isBroken = meta.broken or false;
|
||||||
|
platforms = meta.hydraPlatforms or meta.platforms or allSystems;
|
||||||
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 derviations
|
||||||
isDerivation v && !meta.broken && builtins.elem system platforms
|
isDerivation v && !isBroken && builtins.elem system platforms
|
||||||
;
|
;
|
||||||
in
|
in
|
||||||
filterAttrs sieve packages
|
filterAttrs sieve packages
|
||||||
|
|
Loading…
Reference in New Issue