[Nix-dev] quoted vs unquoted urls in Nix expressions
Marc Weber
marco-oweber at gmx.de
Sun Feb 17 15:16:28 CET 2013
> 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)
Marc Weber
More information about the nix-dev
mailing list