[Nix-dev] Providing more explicit nix installation instructions
Ellis Whitehead
ellis.whitehead at gmail.com
Sat Jan 12 09:12:53 CET 2013
Over the past couple months, I've installed nix about ten times on
various systems, where the underlying system was either ubuntu,
archlinux, centos, mac os x, or directly nixos. I've also set it up
for administration through a user account, via sudo, and for multiple
users.
Sometimes things have worked out, sometimes they haven't. Usually,
the documentation lacks a bit of explicit (sometimes vital) detail.
Since I'll probably go through this processes occasionally in the
future, I'd be willing to add my findings to the wiki or the
documentation, if this would be of interest?
Perhaps to start with: I wanted to install it on a Ubuntu 12.10 system
from a user account, and noticed something weird:
# Try to install the .deb
$ sudo dpkg -i ~/Downloads/nix_1.3-1_amd64.deb
# There were missing dependencies, so install them as follows:
$ sudo apt-get update
$ sudo apt-get install -f
# Now this is the problem:
$ sudo nix-channel --add http://nixos.org/channels/nixpkgs-unstable
That created the file $HOME/.nix-channels in my USER home, but with
owner root. Obviously not the correct behavior. The following `sudo
nix-channel --update` failed (sorry, don't have the error message
anymore). Any suggestions for a better way to do this?
To get around the problem, I did something like the following:
$ sudo rm ~/.nix-channels
$ source /etc/profile.d/nix.sh
The last command created ~/.nix-channels with the proper ownership and
contents. I suppose it knew which channel to put in .nix-channels
because of the first invocation of `nix-channel -add`? Should I have
sourced nix.sh before calling `sudo nix-channel` the first time?
Anyhow, after that, the following command *was* successful, and I
could subsequently install software.
$ sudo nix-channel --update
Best regards,
Ellis
More information about the nix-dev
mailing list