[Nix-dev] Function to look up symbols dynamically?

Bryan Ferris primummoven at gmail.com
Tue Mar 7 21:51:51 CET 2017


Hello,

I see in the Nix manual that hasAttr and getAttr exist to allow developers
to dynamically access elements of sets. However, I could not find any
equivalent function for dynamically getting a variable. For example, being
able to say:

(lookup "programs").zsh = { enable = true; }

Of course, the above usage is not useful, but it becomes useful if you
replace the "programs" string with a variable.

Is there any way to achieve this in Nix?

Thanks,
Bryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20170307/32e94073/attachment-0001.html>


More information about the nix-dev mailing list