help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Root guix dereferencing


From: Clément Lassieur
Subject: Re: Root guix dereferencing
Date: Mon, 19 Nov 2018 16:06:01 +0100
User-agent: mu4e 1.0; emacs 26.1

Thorsten Wilms <address@hidden> writes:

> On 19/11/2018 15.07, Clément Lassieur wrote:
>> It doesn't need to contain 'sudo' and 'root', because 'root' is just a
>> user, so everything works the same way.
>
> $: which guix
> /home/thorwil/.config/guix/current/bin/guix
>
> $: sudo which guix
> /usr/local/bin/guix
>
> $ sudo -E which guix
> /usr/local/bin/guix
>
> $: sudo -i
> address@hidden:~# which guix
> /root/.guix-profile/bin/guix
>
> I wouldn't describe that as working the same way, especially since only the
> symlinks for the plain user are being updated.

If you check ~root/.config/guix/current/bin/guix, you'll see that it's
updated when you run 'guix pull' as root.  If you want that guix to be
used for your 'root' user, you just need to make sure
~root/.config/guix/current/bin/ is first in root's $PATH.

You can substitute 'root' with whatever else in the above statement.

'sudo', however, is more tricky to use.  I only use it for 'guix system
reconfigure' because it requires root's privileges.  'sudo -E guix
system reconfigure config.scm' would for example use my own environment
variables, thus my own guix, with root's privileges.

If you are using Ubuntu, you don't need to use that command though, but
you need your systemd's guix-daemon to point to a recent guix.  It could
be either the one updated by root's 'guix pull', or the one updated by
your current user's 'guix pull'.  I chose the latter because I want to
run 'guix pull' only once.

Does it make more sense?
Clément



reply via email to

[Prev in Thread] Current Thread [Next in Thread]