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

Ellis Whitehead ellis.whitehead at gmail.com
Wed Oct 31 22:53:25 CET 2012


Hi Eelco,

> This should be fixed in Nix 1.2. Can you try the most recent pre-release
> (http://hydra.nixos.org/view/nix/trunk/latest)?

After running nix-finish-install, /etc/profile.d/nix.sh pointed to
/root/.nix-profile/etc/profile.d/nix.sh.  I had to change this to
/nix/var/nix/profiles/default/etc/profile.d/nix.sh in order for my
user account to be able to source /etc/profile.d/nix.sh.

After making that fix, it works now.  Thanks for your help.

Ellis


On Mon, Oct 29, 2012 at 5:22 PM, Ellis Whitehead
<ellis.whitehead at gmail.com> wrote:
> 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