Created
June 28, 2019 20:00
-
-
Save mbakke/67c35079fd685ad0aa4fe4f1d3d71b04 to your computer and use it in GitHub Desktop.
Guix on a foreign distribution (/etc/profile.d/guix.sh)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If GUIX_PROFILE is set while sourcing the profile, the variables will | |
# refer to that instead of just the latest generation of the profile. | |
GUIX_PROFILE="${HOME}/.guix-profile" | |
if [[ -L "${GUIX_PROFILE}" ]]; then | |
. "${GUIX_PROFILE}/etc/profile" | |
fi | |
# Make sure the Guix from "guix pull" appears first in PATH. | |
export PATH="${HOME}/.config/guix/current/bin:${PATH}" | |
export INFOPATH="$HOME/.config/guix/current/share/info:$INFOPATH" | |
# If the user installed their own locales, use those. Guix will | |
# internally fall back to "glibc-utf8-locales" if this is not set. | |
if [[ -d "${GUIX_PROFILE}/lib/locale" ]]; then | |
export GUIX_LOCPATH="${GUIX_PROFILE}/lib/locale" | |
fi | |
# This is a hack to make "man" work for Guix and Debian when the | |
# user have "man-db" in their profile. | |
if [[ -n "${MANPATH}" && -d /usr/share/man && ! ${MANPATH} =~ /usr/share/man ]]; then | |
export MANPATH="${MANPATH}:/usr/share/man" | |
fi | |
# Similarly, source bash completions from the user profile. | |
GUIX_BASHCOMPDIRS=("${HOME}/.config/guix/current/etc/bash_completion.d" | |
"${GUIX_PROFILE}/etc/bash_completion.d") | |
for dir in "${GUIX_BASHCOMPDIRS[@]}"; do | |
if [[ -d "${dir}" ]]; then | |
for f in "${dir}/*"; do | |
. $f | |
done | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment