On 25/08/16 21:31, Vladimír Čunát wrote:
> On 08/24/2016 01:04 PM, Matan Shenhav wrote:
>> Is there a resource covering the rules for variables, values and
>> functions? I am still somewhat confused because if I define func = x:
>> x=="x" I do not need to antiquote with ${}.
> 

You only need to antiquote when doing attribute access (and a few other
oddball situations). For example config.networking.hostName is is
equivalent to config."networking"."hostname". This makes attribute much
easier in the general case. So if you want to do dynamic attribute
access you need to antiquote systemd.services."${srv-name}" or if it is
solely one variable as in that example you can drop the quotes.

Note that in you example that x is always treated as a variable as it is
not in an attribute lookup. Much the same that `config` didn't need to
be quoted in the above examples.

Hope that helps, Kevin

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
nix-dev mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to