guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/03: etc/guix-install.sh: Initialize XDG base directories.


From: guix-commits
Subject: 01/03: etc/guix-install.sh: Initialize XDG base directories.
Date: Mon, 4 Jul 2022 17:40:19 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 23aafc800c9e678662766440916449ec5bbce830
Author: Philip McGrath <philip@philipmcgrath.com>
AuthorDate: Sun Jul 3 22:35:02 2022 -0400

    etc/guix-install.sh: Initialize XDG base directories.
    
    The default values from the XDG base directory specification make little
    sense for Guix System, and some scripts in Guix assume that they are not
    "empty or unset": for example, see <https://issues.guix.gnu.org/56050>.
    On foreign distros, however, omitting the default values is likely to
    break software from the distro, perhaps even preventing the desktop
    environment from starting. To smooth over the difference, use the
    system-wide configuration to ensure the environment variables are always
    explicitly set on foreign distros.
    
    * etc/guix-install.sh (sys_create_init_profile): Explicitly initialize
    XDG base directory variables.
    
    Signed-off-by: Ludovic Court├Ęs <ludo@gnu.org>
---
 etc/guix-install.sh | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index cd1a1c34c1..62a33a55c4 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"
@@ -522,7 +532,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
 }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]