diff --git a/bash/.bashrc b/bash/.bashrc index 0d486a8..18319d3 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -23,15 +23,19 @@ fi export PS1="${green}"'\$'"${no_color} " export DIRENV_PS1="${red}"'\$'"${no_color} " +export NIX_SHELL_PS1="${blue}"'λ'"${no_color} " if [ "${HOSTNAME}" != "crypt" ] && [ "${HOSTNAME}" != "tomb" ] || [ "${SSH_TTY}" != "" ]; then DIRENV_PS1="${DIRENV_PS1}${blue}${HOSTNAME} ${DIRENV_PS1}" + NIX_SHELL_PS1="${NIX_SHELL_PS1}${green}${HOSTNAME} ${NIX_SHELL_PS1}" PS1="${PS1}${blue}${HOSTNAME} ${PS1}" fi export ORIG_PS1=${PS1} if which direnv &> /dev/null; then update_prompt() { - if direnv status | grep -iEq 'RC allowed (true|0)'; then + if [ -n "${IN_NIX_SHELL}" ]; then + PS1=${NIX_SHELL_PS1} + elif direnv status | grep -iEq 'RC allowed (true|0)'; then PS1=${DIRENV_PS1} else PS1=${ORIG_PS1}