summaryrefslogtreecommitdiff
path: root/modules/examples
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2018-01-17 01:54:02 +0100
committerDaiderd Jordan <daiderd@gmail.com>2018-01-17 01:54:02 +0100
commit4d4acf65509319d56ca6f3ee2970d77b3f82b73f (patch)
treebc7ef8a45bf721b53b81a189bd60a30c1774da13 /modules/examples
parent2aeaa86bc770fdf8fae94e456ffe797640583984 (diff)
zsh: don't clobber promptInit in a nix-shell
Configure this yourself if you want a different prompt when a nix-shell is active.
Diffstat (limited to 'modules/examples')
-rw-r--r--modules/examples/lnl.nix8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/examples/lnl.nix b/modules/examples/lnl.nix
index 0173e82..e21c2ad 100644
--- a/modules/examples/lnl.nix
+++ b/modules/examples/lnl.nix
@@ -203,8 +203,12 @@
programs.zsh.promptInit = ''
autoload -U promptinit && promptinit
- PROMPT='%B%(?..%? )%b⇒ '
- RPROMPT='%F{green}%~%f'
+ if [ -n "$IN_NIX_SHELL" ]; then
+ PS1='%F{green}%B[nix-shell]%#%b%f '
+ else
+ PS1='%B%(?..%? )%b⇒ '
+ fi
+ RPS1='%F{green}%~%f'
'';
programs.zsh.loginShellInit = ''