From ca4af74fca3be9e4d3a84bb93c1ff5bd38361047 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Sun, 8 Jul 2018 11:28:08 +0200 Subject: lnl: update nix prompt --- modules/examples/lnl.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'modules/examples') diff --git a/modules/examples/lnl.nix b/modules/examples/lnl.nix index a415860..99ee65c 100644 --- a/modules/examples/lnl.nix +++ b/modules/examples/lnl.nix @@ -203,12 +203,14 @@ programs.zsh.promptInit = '' autoload -U promptinit && promptinit - if [ -n "$IN_NIX_SHELL" ]; then - PS1='%F{green}%B[nix-shell]%#%b%f ' - else - PS1='%B%(?..%? )%b⇒ ' - fi - RPS1='%F{green}%~%f' + setopt PROMPTSUBST + + _prompt_nix() { + [ -z "$IN_NIX_SHELL" ] || echo "%F{yellow}%B[''${name:+$name}]%b%f " + } + + PS1='%F{red}%B%(?..%? )%b%f%# ' + RPS1='$(_prompt_nix)%F{green}%~%f' ''; programs.zsh.loginShellInit = '' -- cgit v1.2.3