unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Julien Lepiller <julien@lepiller.eu>
To: help-guix@gnu.org, Kenan Toker <kenan@kdtsh.net>
Subject: Re: Profile sourcing and $GUIX_PROFILE when using guix home
Date: Wed, 29 Sep 2021 11:15:13 -0400	[thread overview]
Message-ID: <8E8F363C-9043-4CC0-B07C-8F0C072157A1@lepiller.eu> (raw)
In-Reply-To: <40125902-9729-a0e2-c0e5-514e06c0fe69@kdtsh.net>

Le 29 septembre 2021 09:10:44 GMT-04:00, Kenan Toker <kenan@kdtsh.net> a écrit :
>Hello wonderful Guix users and developers!
>
>I am looking for some help understanding fundamental concepts in Guix. 
>In particular, I want to better understand how $GUIX_PROFILE works, and 
>how profiles are sourced when I boot, login, etc. I am using Guix System 
>and generally keep up-to-date with the main branch, usually running a 
>guix pull every other day before I make any configuration changes or 
>install new packages.
>
>I have recently started using guix home, and my $GUIX_PROFILE is 
>automatically set to:
>     ~/.guix-home/profile
>This is currently a symlink to the directory:
>     /gnu/store/708xnkkd86xf4nx9mmf8szpwi4yd9ms2-profile/
>
>I also have a symlink in my $HOME called ~/.guix-profile, which links to:
>     /var/guix/profiles/per-user/me/guix-profile
>This links to the symlink:
>     /var/guix/profiles/per-user/me/guix-profile-n-link
>Which in turn currently links to the directory:
>     /gnu/store/3mjlciy8fywyvajcxy76gy3dscp1bmns-profile/
>
>What I am wondering is:
>     1. Where is $GUIX_PROFILE set for my user, and how has this changed 
>since using guix home?
>     2. ~/.guix-profile/etc/profile seems to have been sourced at some 
>point between booting, logging into my account, and opening an 
>interative shell, because all my packages are present when I run `guix 
>package -I`; I also have all the packages I expect in Gnome Shell. 
>How/when was ~/.guix-profile/etc/profile sourced if it is not set to 
>$GUIX_PROFILE?
>
>Slightly related: before I started using guix home, I found that my 
>$GUIX_PROFILE would sometimes be set to ~/.config/guix/current, which 
>links to:
>     /var/guix/profiles/per-user/me/current-guix
>This links to the symlink:
>     /var/guix/profiles/per-user/me/current-guix-n-link
>Which in turn currently links to the directory:
>     /gnu/store/n6syypzqx7cfr7ypd56ww04313xh888k-profile/
>
>(This behaviour, where $GUIX_PROFILE was ~/.config/guix/current instead 
>of ~/.guix-profile, did not always happen - I have never found a clear 
>pattern as to why it happened when it did. I did find that it would 
>correlate with unexpected behaviour like my laptop not suspending on lid 
>close, but I have never determined the exact cause of this so it might 
>not be related.)
>
>I understand that ~/.config/guix/current is a profile containing the 
>current version of Guix (along with the channels I use), and that 
>~/.guix-profile is a profile containing packages installed to the 
>default profile. On this, I am wondering
>     1. How it is that both ~/.config/guix/current/etc/profile and 
>~/.guix-profile/etc/profile are sourced at some point before or during 
>login?
>     2. Why it was that $GUIX_PROFILE would sometimes be set to 
>~/.config/guix/current (before I started using guix home)?
>
>Thanks a lot everyone,
>Kenan
>

GUIX_PROFILE is not used by guix ittelf, it's only a convenience variable that's set just before sourcing said profile.

On a foreign distro, you'll find the code that loads your profile in /etc/profile.d/guix.sh

On the guix system, it's /etc/profile directly.

In addition, you might have some code in ~/.profile or ~/.bash_profile.

As you can see, GUIX_PROFILE's value changes multiple times, which explains why multiple profiles are loaded in the environment.


  reply	other threads:[~2021-09-29 15:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-29 13:10 Profile sourcing and $GUIX_PROFILE when using guix home Kenan Toker
2021-09-29 15:15 ` Julien Lepiller [this message]
2021-09-30 23:04   ` Kenan Toker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8E8F363C-9043-4CC0-B07C-8F0C072157A1@lepiller.eu \
    --to=julien@lepiller.eu \
    --cc=help-guix@gnu.org \
    --cc=kenan@kdtsh.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).