# Guix pull and GUIX\_PROFILE variable

**URL:** <https://forum.systemcrafters.net/t/guix-pull-and-guix-profile-variable/1420>\
**Category:** Guix\
**Created:** [February 26, 2025, 9:21pm UTC](https://forum.systemcrafters.net/t/guix-pull-and-guix-profile-variable/1420 "2025-02-26T21:21:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![juanpamf](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/juanpamf/32/197_2.png) [@juanpamf](https://forum.systemcrafters.net/u/juanpamf)\
**Post date:** [February 26, 2025, 9:21pm UTC](https://forum.systemcrafters.net/t/guix-pull-and-guix-profile-variable/1420/1 "2025-02-26T21:21:44Z")

</div>

In the getting started documentation (and in daviwil’s article) I can see that:

1- I should set my GUIX\_PROFILE path (usually to the default $HOME/.guix-profile) and source the $GUIX\_PROFILE/etc/profile so all env vars are well set and pointing to my packages (e.g in the default profile). These lines are added to .bash\_profile also.

2- But also, the first time I run guix pull, the documentations sayd after that I should change the GUIX\_PROFILE path - since the freshest guix instance is elsewhere in .config/guix/current, and source from there the env vars (etc/profile). Finally, it is said these two lines should be added to bash\_profile.

I don’t get why in the second step I should add these lines to bash\_profile:

- now in my bash profile I have 2 competing/colliding definitions of GUIX\_PROFILE and of course the second one overrides the first.

- Shouldn’t I choose which profile I want to use by default?

- Isn’t the new guix command that was just pulled by guix pull to be pointed only once for the guix upgrade?

Finally I would understand if I temporarily misdirect the GUIX\_PROFILE variable to .config/guix/current, e.g by inserting the two lines in my shell, but I do not get why these lines should go into bash\_profile.

Any hints on this?

---

<div class="post-metadata">

**Author:** ![juanpamf](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/juanpamf/32/197_2.png) [@juanpamf](https://forum.systemcrafters.net/u/juanpamf)\
**Post date:** [February 27, 2025, 12:09am UTC](https://forum.systemcrafters.net/t/guix-pull-and-guix-profile-variable/1420/2 "2025-02-27T00:09:11Z")

</div>

Few things I found:

- PATH already contains both $HOME/.guix-profile and $HOME/.config/guix/current, both are set by /etc/profile.d/zzz.guix.sh.

- $GUIX\_PROFILE/etc/profile prepends $GUIX\_PROFILE/bin to PATH, giving it “higher priority”.

I can’t really test what was guix first install path, but I guess this first setting for guix pull is linked to that (I might check in the guix-install.sh).

Anyway it all comes to where the guix command is located, and where PATH lookups first.

I prefer not really adding the .config/guix/current in my bash\_profile, but I’ll see on other guix pull if I really need to. I guess also putting both values of GUIX\_PROFILE in .bash\_profile but current first and default next (or your profile of choice) would be another good default for me.

---

<div class="post-metadata">

**Author:** ![easilok](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/easilok/32/940_2.png) [@easilok](https://forum.systemcrafters.net/u/easilok)\
**Post date:** [March 2, 2025, 2:28pm UTC](https://forum.systemcrafters.net/t/guix-pull-and-guix-profile-variable/1420/3 "2025-03-02T14:28:40Z")

</div>

Hello Juan,

Heads up, I’m actually starting the usage of guix in my workflow, and using only as package manager, so I’m also not 100% sure on what I’ll say.

As far as I understood, the default “$HOME/.guix-profile” is where the packages are installed when using `guix package`. The “$HOME/.config/guix/current” is where the latest pulled repository information is saved as well as the latest `guix` binary, that is updated with a `guix pull`.

That’s why the “$HOME/.config/guix/current/bin” should be the highest priority in PATH, to use the latest `guix`, and the default profile the “$HOME/.guix-profile”, where the installed packages are.

---

<div class="post-metadata">

**Author:** ![mirkoh](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@mirkoh](https://forum.systemcrafters.net/u/mirkoh)\
**Post date:** [March 2, 2025, 6:30pm UTC](https://forum.systemcrafters.net/t/guix-pull-and-guix-profile-variable/1420/4 "2025-03-02T18:30:07Z")

</div>

When starting out with guix this was very confusing to me. It seems that GUIX\_PROFILE is just a variable that is used to source the profiles.

Here is my bash\_profile. As you can see I’m using extra profiles, GUIX\_PROFILE is used to source each one and then it is set to .guix-profile to source it. Previously in .profile guix home sources its own profile in setup-environment.

```auto
# Set up the system, user profile, and related variables.
# /etc/profile will be sourced by bash automatically
# Set up the home environment profile.

if [-z "$XDG_RUNTIME_DIR"]; then
	XDG_RUNTIME_DIR="/tmp/$(id -u)-runtime-dir"

	mkdir -pm 0700 "$XDG_RUNTIME_DIR"
	export XDG_RUNTIME_DIR
fi

if [-f ~/.profile]; then
   source ~/.profile;
fi

# Honor per-interactive-shell startup file
if [-f ~/.bashrc]; then
   source ~/.bashrc;
fi

PS1='\u@\h \w${GUIX_ENVIRONMENT:+ [env]}\$ '

export GUIX_EXTRA_PROFILES="$HOME/.guix-extra-profiles"

# Source extra profiles
for i in $GUIX_EXTRA_PROFILES/*; do
  profile=$i/$(basename "$i")
  if [-f "$profile"/etc/profile]; then
    GUIX_PROFILE="$profile"
   . "$GUIX_PROFILE"/etc/profile
  fi
  unset profile
done

# Source guix-profile
export GUIX_PROFILE=~/.guix-profile
. $GUIX_PROFILE/etc/profile

["$(tty)" = "/dev/tty1"] && exec sway -d

```
