[Nix-dev] quoted vs unquoted urls in Nix expressions

Bjørn Forsman bjorn.forsman at gmail.com
Sun Feb 17 15:35:04 CET 2013


On 17 February 2013 15:16, Marc Weber <marco-oweber at gmx.de> wrote:
>> What is the difference between quoted and unquoted URLs in Nix
>> expressions? In nixpkgs the fetchurl urls are sometimes quoted and
>> sometimes not.
>
> nix has urls as native type AFAIK.
> let str = 'foo'
> let url= http://bar
>
> The latter catches typos such as http:/bar, because its not a valid URL.
> However invalid urls will be caught be the build anyway usually.
>
> Common usage interpolation is only possible with strings AFAIK:
> let url = "http://fooo-${version}";
>
> Does it make a difference? In the end: No because AFAIK nix passes urls
> and strings the same way as env vars to the builder.
>
> For completness let's also compare with file paths:
> ./bar will be turned into an absolute path. However the path is not
> passed to the builder, instead bar is copied to the store, and that
> store file is passed to the builder so that everything works as expected
> also in chroot builds (which are default now AFAIK)

Ok. Thanks for explaining.

Best regards,
Bjørn Forsman


More information about the nix-dev mailing list