From 201a337a0da4122992e7e61bc37c240378c25d0a Mon Sep 17 00:00:00 2001 From: n3oney Date: Wed, 3 May 2023 00:06:49 +0200 Subject: [PATCH] fix: make addDescriptionsToMappings recurse on attrsets --- lib/stdlib-extended.nix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/stdlib-extended.nix b/lib/stdlib-extended.nix index 50fa80b6..a54e5e93 100644 --- a/lib/stdlib-extended.nix +++ b/lib/stdlib-extended.nix @@ -46,10 +46,17 @@ in # and merges them into # { someKey = { value = "some_value"; description = "Some Description"; }; } addDescriptionsToMappings = actualMappings: mappingDefinitions: - self.attrsets.mapAttrs (name: value: { - value = value; - description = mappingDefinitions."${name}".description; - }) + self.attrsets.mapAttrs (name: value: let + isNested = self.isAttrs value; + returnedValue = + if isNested + then addDescriptionsToMappings actualMappings."${name}" mappingDefinitions."${name}" + else { + value = value; + description = mappingDefinitions."${name}".description; + }; + in + returnedValue) actualMappings; mkSetBinding = binding: action: