summaryrefslogtreecommitdiff
path: root/modules/examples
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2018-07-08 11:28:08 +0200
committerDaiderd Jordan <daiderd@gmail.com>2018-07-08 11:53:54 +0200
commitca4af74fca3be9e4d3a84bb93c1ff5bd38361047 (patch)
tree70e64d18537a76597be60ad20dbfc680bbb3f8ea /modules/examples
parent4cd5454f29c25a33dad38a90473956f8c9746d3a (diff)
lnl: update nix prompt
Diffstat (limited to 'modules/examples')
-rw-r--r--modules/examples/lnl.nix14
1 files changed, 8 insertions, 6 deletions
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 = ''