Add direnv support

This commit is contained in:
Loic Nageleisen 2021-07-06 15:01:05 +02:00
parent d52e1d1f82
commit 52e20aca38
Signed by: lloeki
GPG key ID: 971B4D9F125CD31E
5 changed files with 28 additions and 0 deletions

21
shell/direnv Executable file
View file

@ -0,0 +1,21 @@
if command -v direnv 2>&1 >/dev/null; then
if [[ -n $BASH_VERSION ]]; then
# eval "$(direnv hook bash)"
_direnv_hook() {
local previous_exit_status=$?;
trap -- '' SIGINT;
eval "$("${HOME}/.nix-profile/bin/direnv" export bash)";
trap - SIGINT;
return $previous_exit_status;
};
fi
if [[ -n $ZSH_VERSION ]]; then
# eval "$(direnv hook zsh)"
_direnv_hook() {
trap -- '' SIGINT;
eval "$("${HOME}/.nix-profile/bin/direnv" export zsh)";
trap - SIGINT;
}
fi
fi

View file

@ -5,4 +5,6 @@
#export DOCKER_CERT_PATH="/Users/lloeki/.docker/machine/machines/default"
#export DOCKER_MACHINE_NAME="default"
export DOCKER_HOST=ssh://172.16.50.2
# vim: ft=bash