33 lines
547 B
Text
33 lines
547 B
Text
has() {
|
|
command -V "$1" > /dev/null 2>&1
|
|
}
|
|
|
|
source_if() {
|
|
if [ -e "$1" ]; then
|
|
source "$1"
|
|
fi
|
|
}
|
|
|
|
path_if() {
|
|
if [ -d "$1" ]; then
|
|
case ":$PATH:" in
|
|
*:"$1":*)
|
|
;;
|
|
*)
|
|
PATH="${1}${PATH:+:$PATH}"
|
|
esac
|
|
fi
|
|
}
|
|
|
|
source_if "${HOME}/.nix-profile/etc/profile.d/nix.sh"
|
|
|
|
path_if "$HOME/bin"
|
|
path_if "$HOME/.local/bin"
|
|
|
|
unset -f source_if
|
|
unset -f path_if
|
|
|
|
if has gnome-keyring-daemon; then
|
|
eval "$(gnome-keyring-daemon --start)"
|
|
export SSH_AUTH_SOCK
|
|
fi
|