On 08/03/2025 04:00, 宋文武 wrote: > Richmond via <help-guix@gnu.org> writes: > >> [...] >> I have found that using: >> >> su - guix >> >> executes /etc/profile which executes /etc/profile.d/guix.sh >> >> But logging in through a display manager does not execute this, or if it >> does, the PATH does not get set to include .guix-profile/bin etc. > Yes, /etc/profile will be loaded only when the shell is a login shell, > which display managers usually doesn't ensure that. See "INVOCATION" in > 'man bash'. > I have put this code in .bashrc which seems to fix things.
if [[ ":$PATH:" != *":$HOME/.guix-profile/bin:"* ]]; then source /etc/profile.d/guix.sh fi