[Nix-dev] sudo and nix-channel (was: Re: NixOS channel)

Florian Friesdorf flo at chaoflow.net
Sat Jun 16 23:02:41 CEST 2012


On Tue, 15 May 2012 14:11:43 -0400, Eelco Dolstra <eelco.dolstra at logicblox.com> wrote:
> Hi all,
> 
> Since a few weeks there is a NixOS channel, which is now the default mechanism
> for keeping NixOS up to date.  (A channel is a Nix mechanism for distributing a
> consistent set of Nix expressions and binaries.)  A quick summary on how to use it:
> 
> $ nix-channel --add http://nixos.org/releases/nixos/channels/nixos-unstable
> $ nix-channel --update

$ sudo nix-channel --add ...

creates the ~/.nix-channels in the HOME of the user running sudo, not /root.

$ sudo nix-channel --update

creates ~/.nix-defexpr/channels in the HOME of the user running sudo,
not /root.


$ sudo -i
# nix-channel --add ...
# nix-channel --update

work like expected inside /root.


It feels not many people are using sudo to directly run commands or to
rephrase: is anybody except me using sudo without -i?

Do we want to support running commands with sudo and if, what is the
expected behaviour?

Use user config but do things as root?
Use root config and do things as root?

I think the latter, as using user config as root is dangerous and
especially in case of the channels, feels wrong.

better:

$ nix-channel --add  (adds a channel for the current user)
$ sudo nix-channel --add (adds a channel for root)


regards
florian
-- 
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/20120616/f13d7e9f/attachment.bin 


More information about the nix-dev mailing list