summaryrefslogtreecommitdiff
path: root/modules/programs
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2017-07-09 10:14:49 +0200
committerDaiderd Jordan <daiderd@gmail.com>2017-07-09 10:14:49 +0200
commit71f25cba9d530e3e7f58bd4698b8595dc1373927 (patch)
tree47c1e484e7f11219971e73874eb62db3adaaabee /modules/programs
parent8c29d0985d74b4a990238497c47a2542a5616b3c (diff)
zsh: support nix-shell --run zsh
Diffstat (limited to 'modules/programs')
-rw-r--r--modules/programs/zsh/default.nix7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/programs/zsh/default.nix b/modules/programs/zsh/default.nix
index faff65a..88b79b1 100644
--- a/modules/programs/zsh/default.nix
+++ b/modules/programs/zsh/default.nix
@@ -165,6 +165,12 @@ in
${optionalString cfg.enableFzfGit "source ${fzfGit}"}
${optionalString cfg.enableFzfHistory "source ${fzfHistory}"}
+ # Don't execute this file when running in a nix-shell.
+ if test ''${IN_NIX_SHELL:-0} -eq 1; then
+ PS1='%F{green}%B[nix-shell:%~]%#%b%f '
+ return
+ fi
+
# Only execute this file once per shell.
if [ -n "$__ETC_ZSHRC_SOURCED" -o -n "$NOSYSZSHRC" ]; then return; fi
__ETC_ZSHRC_SOURCED=1
@@ -197,7 +203,6 @@ in
"source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
}
-
# Read system-wide modifications.
if test -f /etc/zshrc.local; then
source /etc/zshrc.local