[Nix-dev] Merge attribute sets recursively

4levels 4levels at gmail.com
Wed Jun 15 21:37:01 CEST 2016


Hi Daniel,

Thanks for the pointer, I'll get on with it and report back here ;-)

On Wed, Jun 15, 2016, 21:33 Daniel Hlynskyi <abcz2.uprola at gmail.com> wrote:

> Does lib.recursiveUpdate do the job?
> 15 черв. 2016 7:52 пп, користувач "4levels" <4levels at gmail.com> написав:
>
>> Hi Nix Devs,
>>
>> I'm still struggling to achieve the following:
>>
>> I have an attribute set which is 2 levels deep nested and has a variable
>> number of subsets, like this:
>>
>> channels = {
>>   myallocator = {
>>     "1" = {
>>       username = "demo1";
>>     };
>>     "2" = {
>>       username = "demo2";
>>     };
>>     ...
>>   };
>> };
>>
>> I want to add some more attributes to each final level so the resulting
>> set would be something like (where uri and timeout are added to each
>> subset)
>>
>> channels = {
>>   myallocator = {
>>     "1" = {
>>       username = "demo1";
>>       uri = "https://api.myallocator.com";
>>       timeout = "60";
>>     };
>>     "2" = {
>>       username = "demo2";
>>       uri = "https://api.myallocator.com";
>>       timeout = "60";
>>     };
>>     ...
>>   };
>> };
>>
>> How can I achieve this?
>>
>> Thank you in advance!
>>
>> Kind regards,
>>
>>
>> Erik
>>
>>
>>
>>
>> _______________________________________________
>> nix-dev mailing list
>> nix-dev at lists.science.uu.nl
>> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160615/a61902a7/attachment.html>


More information about the nix-dev mailing list