Sergio Pastor Pérez <sergio.pastorpe...@gmail.com> writes:

> Hi,
>
> Malte Frank Gerdes <malte.f.ger...@gmail.com> writes:
>
>> Hi,
>>
>> for me `guix system reconfigure` inevitably needs sudo, so i'm not
>> actually running it under my user (where i regularly guix pull). So the
>> guix checkout of root is most likely older, hence i find it useful that
>> it first pulls. guix pull only updates the guix checkout for the current
>> user and while i have seen patches allowing to share a single checkout
>> with multiple users this isn't the default and has its own
>> disadvantages.
>
> Try using the -E flag from sudo[1] to preserve the user environment, like so:
> --8<---------------cut here---------------start------------->8---
> sudo -E guix system ...
> --8<---------------cut here---------------end--------------->8---
>
> This will ensure that sudo uses the same `guix' binary the user has in
> PATH.

That's not it. sudo without -E flag on guix system will also ensure the
same guix binary is used as PATH is passed through. The problem here is
the cache path. It is dangerous to give your user's cache to root as you
might end up with root owned files in your cache. If you want to
share the checkouts, shared-cache-service-type can be used for that.

Rutherther

>
> [1] https://www.sudo.ws/docs/man/1.8.15/sudo.man/#E
>
>
> Best regards,
> Sergio

Reply via email to