|
@@ -8,10 +8,11 @@ local user='%F{yellow}%B%n%b%f'
|
|
local host='%F{blue}%B%M%b%f'
|
|
local host='%F{blue}%B%M%b%f'
|
|
local dir='%F{yellow}%~%f'
|
|
local dir='%F{yellow}%~%f'
|
|
local git='$(git_prompt_string)'
|
|
local git='$(git_prompt_string)'
|
|
-local error='%F{red}%B%(?..%?)%b%f'
|
|
|
|
|
|
+local nix='$(nix_shell_prompt_string)'
|
|
|
|
+local error='%F{red}%B%?%b%f'
|
|
|
|
|
|
PROMPT="$time $user@$host $dir $git%# "
|
|
PROMPT="$time $user@$host $dir $git%# "
|
|
-RPROMPT="$error"
|
|
|
|
|
|
+RPROMPT="%(?.$nix.$error)"
|
|
|
|
|
|
# Show Git branch/tag, or name-rev if on detached head
|
|
# Show Git branch/tag, or name-rev if on detached head
|
|
parse_git_branch() {
|
|
parse_git_branch() {
|
|
@@ -75,3 +76,8 @@ git_prompt_string() {
|
|
fi
|
|
fi
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+nix_shell_prompt_string() {
|
|
|
|
+ if [ -n "$IN_NIX_SHELL" ]; then
|
|
|
|
+ echo "[%F{yellow}nix%f]"
|
|
|
|
+ fi
|
|
|
|
+}
|