[Nix-dev] Installing nix fails, due to missing NIX_LINK?

Ellis Whitehead ellis.whitehead at gmail.com
Mon Oct 29 17:22:08 CET 2012


I would like to try out Nix on Arch linux.  Following the instructions
in section 3.2 at
  http://hydra.nixos.org/build/2860022/download/1/manual/
I ran the following commands:

ellis at lorax:/$ sudo tar tjf ~ellis/Downloads/nix-1.1-x86_64-linux.tar.bz2
ellis at lorax:/$ sudo sudo nix-finish-install

Then continuing in section 3.5, I see that the symlink wasn't properly set:

ellis at lorax:/$ source /etc/profile.d/nix.sh
bash: /etc/profile.d/nix.sh: Too many levels of symbolic links
ellis at lorax:/$ l /etc/profile.d/nix.sh
lrwxrwxrwx 1 root root 21 Oct 29 18:48 /etc/profile.d/nix.sh ->
/etc/profile.d/nix.sh

Looking at nix-finish-install, I see these lines:

# Add nix.sh to the shell's profile.d directory.
p=$NIX_LINK/etc/profile.d/nix.sh

But NIX_LINK hasn't been set yet.  Am I missing something?

So I fixed it by changing the link to
  /nix/store/9sxggh38167a5nf02qbzmsrbr7arbybf-nix-1.1/etc/profile.d/nix.sh
and so now I could source nix.sh as root.

But sourcing nix.sh won't work for a non-root user.  The first of
various errors is:

mkdir: cannot create directory ‘/nix/var/nix/profiles/per-user/ellis’:
Permission denied

Any suggestions?

Thanks,
Ellis


More information about the nix-dev mailing list