summaryrefslogtreecommitdiff
path: root/modules/programs
diff options
context:
space:
mode:
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