[Nix-dev] Providing more explicit nix installation instructions

Florian Friesdorf flo at chaoflow.net
Fri Jan 25 05:11:31 CET 2013


Vladimír Čunát <vcunat at gmail.com> writes:
>>> # 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?
>>
>> sudo -H (see man sudo)
>
> I believe nix-channel --add is supposed to be run *without* sudo anyway 
> (it only sets up ~/.nix* stuff AFAIK).

If you add the channel as a user, it will be added to your home
directory and you need to run `sudo nixos-rebuild ...`. If you add it as
root with `sudo nix-channel ...` it's going to be added to your user's
home and you need to run `sudo nixos-rebuild ...`, too. If you add it
with `sudo -H nix-channel...`, it will be added to root's home and you
need to run `sudo -H nixos-rebuild...`.

I'm not sure about security implications, but it feels like one should
do both with `-H`.

-- 
Florian Friesdorf <flo at chaoflow.net>
  GPG FPR: 7A13 5EEE 1421 9FC2 108D  BAAF 38F8 99A3 0C45 F083
Jabber/XMPP: flo at chaoflow.net
IRC: chaoflow on freenode,ircnet,blafasel,OFTC
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
Url : http://lists.science.uu.nl/pipermail/nix-dev/attachments/20130125/e22ef2aa/attachment.bin 


More information about the nix-dev mailing list