mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2026-11-30 13:03:30 +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:
|
||||
if value == null then
|
||||
[ ]
|
||||
else if builtins.isAttrs value && !(builtins.isList value) && !(value ? _type) then
|
||||
lib.flatten (lib.mapAttrsToList (name: recurse ([ name ] ++ path)) value)
|
||||
else
|
||||
else if !(builtins.isAttrs value) then
|
||||
{
|
||||
conditionals = lib.sort builtins.lessThan (lib.filter (k: k != "all") (lib.tail path));
|
||||
name = lib.head path;
|
||||
inherit value;
|
||||
};
|
||||
}
|
||||
else
|
||||
lib.flatten (lib.mapAttrsToList (name: recurse ([ name ] ++ path)) value);
|
||||
|
||||
# Group flattened items by their conditional filter set, then render.
|
||||
groupItems =
|
||||
|
||||
Reference in new issue
Block a user