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;
|
||||
|
||||
# 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:
|
||||
let
|
||||
matches =
|
||||
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);
|
||||
matches = identifyProfiles profile;
|
||||
in
|
||||
if builtins.length matches == 1
|
||||
then builtins.head matches
|
||||
|
|
Loading…
Reference in New Issue