summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zscripts/nixshell.zsh9
-rwxr-xr-xzshrc2
2 files changed, 10 insertions, 1 deletions
diff --git a/zscripts/nixshell.zsh b/zscripts/nixshell.zsh
new file mode 100644
index 0000000..3cd1206
--- /dev/null
+++ b/zscripts/nixshell.zsh
@@ -0,0 +1,9 @@
+#!/usr/bin/env zsh
+
+# Make nix shell run zsh
+alias nix-shell="nix-shell --command zsh"
+
+# Add nix-shell prefix to prompt in the same style as python venv
+if [ -n "$IN_NIX_SHELL" ]; then
+ PS1PREFIX="(nix-shell) "
+fi
diff --git a/zshrc b/zshrc
index f12c3c2..437dd8e 100755
--- a/zshrc
+++ b/zshrc
@@ -7,7 +7,7 @@ for zscript in "$XDG_CONFIG_HOME/zsh/zscripts"{/[^\!]*.zsh,/hosts/*.$HOST.zsh,/!
# Colors! + Prompt
autoload -U colors && colors
-[ -z "$PS1OVERRIDE" ] && PS1="%B%F{${colbr:-red}}[%F{${colname:-yellow}}%n%F{${colat:-green}}@%F{${colhost:-blue}}%m %b%F{${coljobs:-white}}%1(j.[%j] .)%F{${coldir:-magenta}}%U%~%u%F{${colbr:-red}}]%f%b%(!.#.$) "
+[ -z "$PS1OVERRIDE" ] && PS1="${PS1PREFIX}%B%F{${colbr:-red}}[%F{${colname:-yellow}}%n%F{${colat:-green}}@%F{${colhost:-blue}}%m %b%F{${coljobs:-white}}%1(j.[%j] .)%F{${coldir:-magenta}}%U%~%u%F{${colbr:-red}}]%f%b%(!.#.$) "
# Cd settings
setopt AUTO_CD # `cd` is implied when path is entered