profiles: split identifyProfiles into identifyProfile

This commit is contained in:
Astro 2022-04-28 23:59:17 +02:00
parent fd97d941cd
commit 16cbe77aa0
1 changed files with 13 additions and 11 deletions

View File

@ -21,9 +21,7 @@ in rec {
) hashes;
# filters hardware profiles from all boards.json files
identifyProfile = profile:
let
matches =
identifyProfiles = profile:
builtins.concatMap (target:
map (variant: {
# match return value
@ -34,6 +32,10 @@ in rec {
) (builtins.attrNames allProfiles.${target})
)
) (builtins.attrNames allProfiles);
identifyProfile = profile:
let
matches = identifyProfiles profile;
in
if builtins.length matches == 1
then builtins.head matches