宋文武 <iyzs...@gmail.com> skribis: > How about using a shell variable as input for the location: > (replace /gnu/store/xxx with $GUIX_PROFILE) > > # etc/profile > export PATH=$GUIX_PROFILE/bin:$PATH > export MANPATH=$GUIX_PROFILE/share/man:$MANPATH > ... > > Then when 'source' it, we pass the location: > (we did know where $GUIX_PROFILE is when do the 'source') > > # ~/.bash_profile > GUIX_PROFILE=$HOME/.guix-profile > if [ -f $GUIX_PROFILE/etc/profile ]; then > . $GUIX_PROFILE/etc/profile > fi > > # /etc/profile > GUIX_PROFILE=/run/current-system/profile > source $GUIX_PROFILE/etc/profile
Yes, but we would also like users to be able to source ~/.guix-profile/etc/profile themselves directly, and it wouldn’t be nice to ask them to set GUIX_PROFILE before sourcing it. Ludo’.