mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2026-12-02 22:13:29 +01:00
raspberry-pi/common: simplify a bit the recurse function
This commit is contained in:
1 parent
5fbc0ff5d2
commit
6ca00f6509
1 file changed
+4
-4
@@ -43,14 +43,14 @@ let
|
|||||||
path: value:
|
path: value:
|
||||||
if value == null then
|
if value == null then
|
||||||
[ ]
|
[ ]
|
||||||
else if builtins.isAttrs value && !(builtins.isList value) && !(value ? _type) then
|
else if !(builtins.isAttrs value) then
|
||||||
lib.flatten (lib.mapAttrsToList (name: recurse ([ name ] ++ path)) value)
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
conditionals = lib.sort builtins.lessThan (lib.filter (k: k != "all") (lib.tail path));
|
conditionals = lib.sort builtins.lessThan (lib.filter (k: k != "all") (lib.tail path));
|
||||||
name = lib.head path;
|
name = lib.head path;
|
||||||
inherit value;
|
inherit value;
|
||||||
};
|
}
|
||||||
|
else
|
||||||
|
lib.flatten (lib.mapAttrsToList (name: recurse ([ name ] ++ path)) value);
|
||||||
|
|
||||||
# Group flattened items by their conditional filter set, then render.
|
# Group flattened items by their conditional filter set, then render.
|
||||||
groupItems =
|
groupItems =
|
||||||
|
|||||||
Reference in new issue
Block a user