NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.85k stars 1.52k forks source link

NIX_PATH should support URLs with colons #1434

Open knedlsepp opened 7 years ago

knedlsepp commented 7 years ago

When pointing nix-env to a URL that contains the port number everything works just fine:

nix-env -f "https://nixos.org:443/channels/nixos-16.03-small/nixexprs.tar.xz" -iA vim

However due to the colon being the separator in the NIX_PATH environment variable neither of the following works:

export NIX_PATH=nixpkgs=https://nixos.org:443/channels/nixos-16.03-small/nixexprs.tar.xz
nix-env -f "<nixpkgs>" -iA vim
export NIX_PATH=nixpkgs=https://nixos.org\:443/channels/nixos-16.03-small/nixexprs.tar.xz
nix-env -f "<nixpkgs>" -iA vim
clample commented 7 years ago

It looks like NIX_PATH is correctly parsed if there's a URL but no port numbers. It looks like the second colon from the port number causes two separate paths to be parsed https://nixos.org and 443/channels/nixos-16.03-small/nixexprs.tar.xz

https://github.com/NixOS/nix/blob/561e977f51c1d9ec55e4a70791958d4e214df465/src/libexpr/eval.cc#L238-L271

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info