diff options
Diffstat (limited to 'etc/guix-install.sh')
-rwxr-xr-x | etc/guix-install.sh | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/etc/guix-install.sh b/etc/guix-install.sh index cd1a1c34c1..300681e111 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -504,6 +504,16 @@ sys_create_init_profile() # This will not take effect until the next shell or desktop session! [ -d "/etc/profile.d" ] || mkdir /etc/profile.d # Just in case cat <<"EOF" > /etc/profile.d/guix.sh +# Explicitly initialize XDG base directory variables to ease compatibility +# with Guix System: see <https://issues.guix.gnu.org/56050#3>. +export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" +export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" +export XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}" +export XDG_DATA_DIRS="${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/}" +export XDG_CONFIG_DIRS="${XDG_CONFIG_DIRS:-/etc/xdg}" +export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" +# no default for XDG_RUNTIME_DIR (depends on foreign distro for semantics) + # _GUIX_PROFILE: `guix pull` profile _GUIX_PROFILE="$HOME/.config/guix/current" export PATH="$_GUIX_PROFILE/bin${PATH:+:}$PATH" @@ -514,7 +524,9 @@ export PATH="$_GUIX_PROFILE/bin${PATH:+:}$PATH" export INFOPATH="$_GUIX_PROFILE/share/info:$INFOPATH" # GUIX_PROFILE: User's default profile -GUIX_PROFILE="$HOME/.guix-profile" +# Prefer the one from 'guix home' if it exists. +GUIX_PROFILE="$HOME/.guix-home/profile" +[ -L $GUIX_PROFILE ] || GUIX_PROFILE="$HOME/.guix-profile" [ -L $GUIX_PROFILE ] || return GUIX_LOCPATH="$GUIX_PROFILE/lib/locale" export GUIX_LOCPATH @@ -522,7 +534,7 @@ export GUIX_LOCPATH [ -f "$GUIX_PROFILE/etc/profile" ] && . "$GUIX_PROFILE/etc/profile" # set XDG_DATA_DIRS to include Guix installations -export XDG_DATA_DIRS="$GUIX_PROFILE/share:${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/}" +export XDG_DATA_DIRS="$GUIX_PROFILE/share:$XDG_DATA_DIRS" EOF } |