From 6ca00f65098ee19fc38aedc8bcd58649fc04558d Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Fri, 7 Aug 2026 10:23:28 +0300 Subject: [PATCH] raspberry-pi/common: simplify a bit the `recurse` function --- raspberry-pi/common/config-txt.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/raspberry-pi/common/config-txt.nix b/raspberry-pi/common/config-txt.nix index 71b02708..c6e20cdb 100644 --- a/raspberry-pi/common/config-txt.nix +++ b/raspberry-pi/common/config-txt.nix @@ -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 =