From 790e3cb4df97931963569a9b0ad39878d9257d49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20R=C3=B6ger?= Date: Thu, 18 Apr 2024 11:29:58 +0200 Subject: [PATCH] 44 current 2024-04-18 11:29:51 23.11.20240405.72da83d 6.1.84 * --- .../static/omz_custom/themes/my_bureau.zsh-theme | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/home/jonas/static/omz_custom/themes/my_bureau.zsh-theme b/home/jonas/static/omz_custom/themes/my_bureau.zsh-theme index e87a594..b74cf53 100644 --- a/home/jonas/static/omz_custom/themes/my_bureau.zsh-theme +++ b/home/jonas/static/omz_custom/themes/my_bureau.zsh-theme @@ -17,6 +17,19 @@ ZSH_THEME_GIT_PROMPT_UNSTAGED="%{$fg_bold[yellow]%}●%{$reset_color%}" ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[red]%}●%{$reset_color%}" ZSH_THEME_GIT_PROMPT_STASHED="(%{$fg_bold[blue]%}✹%{$reset_color%})" +bureau_nix_shell () { + if [ -n "$IN_NIX_SHELL" ]; then + if [ -n "$out" ]; then + local name=$(basename $(realpath -mL "$out/../../")) + echo -n "[nix-shell:$name]" + else + echo -n "[nix-shell]" + fi + else + echo -n "" + fi +} + bureau_git_info () { local ref ref=$(command git symbolic-ref HEAD 2> /dev/null) || \ @@ -127,7 +140,7 @@ bureau_precmd () { setopt prompt_subst PROMPT='> $_LIBERTY ' -RPROMPT='$(nvm_prompt_info) $(bureau_git_prompt)' +RPROMPT='$(nvm_prompt_info) $(bureau_nix_shell) $(bureau_git_prompt)' autoload -U add-zsh-hook add-zsh-hook precmd bureau_precmd