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

2015-01-27 Thread Eelco Dolstra
Hi, On 27/01/15 16:58, Wout Mertens wrote: Nix could be extended to accept `rec { foo.bar = test; bar = ${foo.bar};}'? Well, it was probably a mistake to allow string syntax for variable names in the first place. It might be better to allow '.' to be escaped in variables names: rec {

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

2015-01-27 Thread Wout Mertens
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.dols...@logicblox.com wrote: Hi, On 26/01/15 10:55, Peter Simons wrote: consider the following recursive attribute set:

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

2015-01-27 Thread Wout Mertens
So what about `config.environment.etc.hosts.allow`? Make the interface be `config.environment.etc = { path:hosts.allow; ...;};`? On Tue Jan 27 2015 at 5:02:27 PM Eelco Dolstra eelco.dols...@logicblox.com wrote: Hi, On 27/01/15 16:58, Wout Mertens wrote: Nix could be extended to accept `rec

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

2015-01-26 Thread Peter Simons
Hi, consider the following recursive attribute set: rec { foo.bar = test; } Is there any way to refer to foo.bar within that set? The obvious attempt rec { foo.bar = test; foobar1 = foo.bar; # undefined reference foobar2 = foo.bar;#

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

2015-01-26 Thread Eelco Dolstra
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 =