unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Profile sourcing and $GUIX_PROFILE when using guix home
@ 2021-09-29 13:10 Kenan Toker
  2021-09-29 15:15 ` Julien Lepiller
  0 siblings, 1 reply; 3+ messages in thread
From: Kenan Toker @ 2021-09-29 13:10 UTC (permalink / raw)
  To: help-guix


[-- Attachment #1.1.1: Type: text/plain, Size: 2841 bytes --]

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


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 4799 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Profile sourcing and $GUIX_PROFILE when using guix home
  2021-09-29 13:10 Profile sourcing and $GUIX_PROFILE when using guix home Kenan Toker
@ 2021-09-29 15:15 ` Julien Lepiller
  2021-09-30 23:04   ` Kenan Toker
  0 siblings, 1 reply; 3+ messages in thread
From: Julien Lepiller @ 2021-09-29 15:15 UTC (permalink / raw)
  To: help-guix, Kenan Toker

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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Profile sourcing and $GUIX_PROFILE when using guix home
  2021-09-29 15:15 ` Julien Lepiller
@ 2021-09-30 23:04   ` Kenan Toker
  0 siblings, 0 replies; 3+ messages in thread
From: Kenan Toker @ 2021-09-30 23:04 UTC (permalink / raw)
  To: Julien Lepiller, help-guix

That all makes an awful lot of sense ... thanks a lot  Julien :-)

On 30/9/21 01:15, Julien Lepiller wrote:
> 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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-01  2:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-29 13:10 Profile sourcing and $GUIX_PROFILE when using guix home Kenan Toker
2021-09-29 15:15 ` Julien Lepiller
2021-09-30 23:04   ` Kenan Toker

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).