nix-repl> a = "foo"
nix-repl> { ${a}.b = "bar"; }
{ foo = { ... }; }
On Tue, Mar 7, 2017 at 9:51 PM, Bryan Ferris <[email protected]> wrote:
> 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
>
> _______________________________________________
> nix-dev mailing list
> [email protected]
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
>
_______________________________________________
nix-dev mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-dev