profiles: split identifyProfiles into identifyProfile
This commit is contained in:
parent
fd97d941cd
commit
16cbe77aa0
24
profiles.nix
24
profiles.nix
|
@ -21,19 +21,21 @@ in rec {
|
||||||
) hashes;
|
) hashes;
|
||||||
|
|
||||||
# filters hardware profiles from all boards.json files
|
# filters hardware profiles from all boards.json files
|
||||||
|
identifyProfiles = profile:
|
||||||
|
builtins.concatMap (target:
|
||||||
|
map (variant: {
|
||||||
|
# match return value
|
||||||
|
inherit pkgs release target variant profile;
|
||||||
|
}) (
|
||||||
|
builtins.filter (variant:
|
||||||
|
allProfiles.${target}.${variant}.profiles ? ${profile}
|
||||||
|
) (builtins.attrNames allProfiles.${target})
|
||||||
|
)
|
||||||
|
) (builtins.attrNames allProfiles);
|
||||||
|
|
||||||
identifyProfile = profile:
|
identifyProfile = profile:
|
||||||
let
|
let
|
||||||
matches =
|
matches = identifyProfiles profile;
|
||||||
builtins.concatMap (target:
|
|
||||||
map (variant: {
|
|
||||||
# match return value
|
|
||||||
inherit pkgs release target variant profile;
|
|
||||||
}) (
|
|
||||||
builtins.filter (variant:
|
|
||||||
allProfiles.${target}.${variant}.profiles ? ${profile}
|
|
||||||
) (builtins.attrNames allProfiles.${target})
|
|
||||||
)
|
|
||||||
) (builtins.attrNames allProfiles);
|
|
||||||
in
|
in
|
||||||
if builtins.length matches == 1
|
if builtins.length matches == 1
|
||||||
then builtins.head matches
|
then builtins.head matches
|
||||||
|
|
Loading…
Reference in New Issue