fix: make addDescriptionsToMappings recurse on attrsets

This commit is contained in:
n3oney 2023-05-03 00:06:49 +02:00
parent 351803ace0
commit 201a337a0d
No known key found for this signature in database
GPG key ID: C786693DE727850E

View file

@ -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: