[Nix-dev] Problem installing nix 1.1

Richard Wallace rwallace at thewallacepack.net
Tue Oct 30 21:11:15 CET 2012


On Tue, Oct 30, 2012 at 1:01 PM, Michael Raskin <7c6f434c at mail.ru> wrote:
>>I'm trying to install nix on a new machine.  It's running Arch so I
>>decided to use the generic x86_64 binary distribution.  I ran through
>>the steps for using it from a single non-root user account.
>>
>>rwallace:~$ cd /
>>rwallace:/$ sudo tar -jxvf ~/Downloads/nix-1.1-x86_64-linux.tar.bz2
>>[sudo] password for rwallace:
>>tar: Removing leading `/' from member names
>>/usr/bin/nix-finish-install
>>/nix/store/reginfo
>>/nix/store/043zrsanirjh8nbc5vqpjn93hhrf107f-bash-4.2-p24/
>>...
>>rwallace:/$ sudo chown -R rwallace /nix
>>rwallace:/$ nix-finish-install
>>creating /home/rwallace/.nix-profile
>>creating /home/rwallace/.nix-defexpr
>>installing `nix-1.1'
>>error: cannot connect to daemon at
>>`/nix/var/nix/daemon-socket/socket': No such file or directory
>>/usr/bin/nix-finish-install: unable to install Nix into your default profile
>>
>>I tried creating the `/nix/var/nix/daemon-socket` directory and that
>>didn't help.  What am I missing?
>
> You are aiming at user-owned installation? Unset NIX_REMOTE, which is
> apparently currently equal to "daemon" in your shell.
>

Right, I was going for user owned since I'm the only one that uses
this machine.  I considered going the multi-user setup route, but it
seemed like overkill.  After doing some digging I found that the
etc/profile.d/nix.sh script ends with

if test "$USER" != root; then
    export NIX_REMOTE=daemon
else
    unset NIX_REMOTE
fi

So I commented everything out except `unset NIX_REMOTE` and everything
went smoothly after that.

> Or go the root-owned path (bonus: chroots, which is important if your
> /bin/sh is not capable to run full POSIX shell script semantics). Then
> you need to actually start the Nix daemon.


More information about the nix-dev mailing list