diff --git a/gnu/system.scm b/gnu/system.scm index 2755d85..7d1d33e 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -429,35 +429,49 @@ export SSL_CERT_DIR=/etc/ssl/certs export SSL_CERT_FILE=\"$SSL_CERT_DIR/ca-certificates.crt\" export GIT_SSL_CAINFO=\"$SSL_CERT_FILE\" -# Crucial variables that could be missing in the profiles' 'etc/profile' -# because they would require combining both profiles. -# FIXME: See . -export MANPATH=$HOME/.guix-profile/share/man:/run/current-system/profile/share/man -export INFOPATH=$HOME/.guix-profile/share/info:/run/current-system/profile/share/info +# Search paths for GLib schemas, GTK+ icons, and so on. export XDG_DATA_DIRS=$HOME/.guix-profile/share:/run/current-system/profile/share export XDG_CONFIG_DIRS=$HOME/.guix-profile/etc/xdg:/run/current-system/profile/etc/xdg # Ignore the default value of 'PATH'. unset PATH -# Load the system profile's settings. +if [ -x /run/current-system/profile/bin/guix ] +then + # Crucial variables such as 'MANPATH' or 'INFOPATH' may be missing from the + # profiles' individual 'etc/profile'. Thus, combine both profiles when + # computing the search paths. + # + # This may take a few hundred milliseconds, but it's OK because this is + # performed for log-in shells only. + eval `/run/current-system/profile/bin/guix package \\ + -p /run/current-system/profile \\ + -p \"$HOME/.guix-profile\" --search-paths` +else + # In the unlikely case that Guix is not in the global profile, + # fall back to the simpler, yet less accurate method (see + # .) GUIX_PROFILE=/run/current-system/profile \\ . /run/current-system/profile/etc/profile -# Prepend setuid programs. -export PATH=/run/setuid-programs:$PATH - if [ -f \"$HOME/.guix-profile/etc/profile\" ] then # Load the user profile's settings. GUIX_PROFILE=\"$HOME/.guix-profile\" \\ . \"$HOME/.guix-profile/etc/profile\" -else + fi +fi + +if [ ! -f \"$HOME/.guix-profile\" ] +then # At least define this one so that basic things just work # when the user installs their first package. export PATH=\"$HOME/.guix-profile/bin:$PATH\" fi +# Prepend setuid programs. +export PATH=/run/setuid-programs:$PATH + # Append the directory of 'site-start.el' to the search path. export EMACSLOADPATH=:/etc/emacs