[Nix-dev] Can recursive attribute sets refer to quoted attributes?

Wout Mertens wout.mertens at gmail.com
Tue Jan 27 16:58:40 CET 2015


Nix could be extended to accept `rec { "foo.bar" = "test"; bar =
${"foo.bar"};}'?

Is this an important use case?
On Mon Jan 26 2015 at 12:58:25 PM Eelco Dolstra <eelco.dolstra at logicblox.com>
wrote:

> Hi,
>
> On 26/01/15 10:55, Peter Simons wrote:
>
> > consider the following recursive attribute set:
> >
> >     rec
> >     {
> >       "foo.bar" = "test";
> >     }
> >
> > Is there any way to refer to "foo.bar" within that set?
>
> No, except by giving the entire set a name, e.g.
>
>   let attrs = rec { "foo.bar" = ...; x = attrs."foo.bar"; }; in attrs
>
> --
> Eelco Dolstra | LogicBlox, Inc. | http://nixos.org/~eelco/
> _______________________________________________
> 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/20150127/04736a3b/attachment.html 


More information about the nix-dev mailing list