mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-31 04:04:45 +00:00
zsh: don't clobber promptInit in a nix-shell
Configure this yourself if you want a different prompt when a nix-shell is active.
This commit is contained in:
parent
2aeaa86bc7
commit
4d4acf6550
2 changed files with 13 additions and 10 deletions
modules
|
@ -203,8 +203,12 @@
|
||||||
programs.zsh.promptInit = ''
|
programs.zsh.promptInit = ''
|
||||||
autoload -U promptinit && promptinit
|
autoload -U promptinit && promptinit
|
||||||
|
|
||||||
PROMPT='%B%(?..%? )%b⇒ '
|
if [ -n "$IN_NIX_SHELL" ]; then
|
||||||
RPROMPT='%F{green}%~%f'
|
PS1='%F{green}%B[nix-shell]%#%b%f '
|
||||||
|
else
|
||||||
|
PS1='%B%(?..%? )%b⇒ '
|
||||||
|
fi
|
||||||
|
RPS1='%F{green}%~%f'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
programs.zsh.loginShellInit = ''
|
programs.zsh.loginShellInit = ''
|
||||||
|
|
|
@ -163,11 +163,6 @@ in
|
||||||
# /etc/zshrc: DO NOT EDIT -- this file has been generated automatically.
|
# /etc/zshrc: DO NOT EDIT -- this file has been generated automatically.
|
||||||
# This file is read for interactive shells.
|
# This file is read for interactive shells.
|
||||||
|
|
||||||
bindkey -e
|
|
||||||
${optionalString cfg.enableFzfCompletion "source ${fzfCompletion}"}
|
|
||||||
${optionalString cfg.enableFzfGit "source ${fzfGit}"}
|
|
||||||
${optionalString cfg.enableFzfHistory "source ${fzfHistory}"}
|
|
||||||
|
|
||||||
# Only execute this file once per shell.
|
# Only execute this file once per shell.
|
||||||
if [ -n "$__ETC_ZSHRC_SOURCED" -o -n "$NOSYSZSHRC" ]; then return; fi
|
if [ -n "$__ETC_ZSHRC_SOURCED" -o -n "$NOSYSZSHRC" ]; then return; fi
|
||||||
__ETC_ZSHRC_SOURCED=1
|
__ETC_ZSHRC_SOURCED=1
|
||||||
|
@ -179,6 +174,8 @@ in
|
||||||
|
|
||||||
setopt HIST_IGNORE_DUPS SHARE_HISTORY HIST_FCNTL_LOCK
|
setopt HIST_IGNORE_DUPS SHARE_HISTORY HIST_FCNTL_LOCK
|
||||||
|
|
||||||
|
bindkey -e
|
||||||
|
|
||||||
${config.environment.interactiveShellInit}
|
${config.environment.interactiveShellInit}
|
||||||
${cfg.interactiveShellInit}
|
${cfg.interactiveShellInit}
|
||||||
|
|
||||||
|
@ -187,6 +184,8 @@ in
|
||||||
fpath+=($p/share/zsh/site-functions $p/share/zsh/$ZSH_VERSION/functions)
|
fpath+=($p/share/zsh/site-functions $p/share/zsh/$ZSH_VERSION/functions)
|
||||||
done
|
done
|
||||||
|
|
||||||
|
${cfg.promptInit}
|
||||||
|
|
||||||
${optionalString cfg.enableCompletion "autoload -U compinit && compinit"}
|
${optionalString cfg.enableCompletion "autoload -U compinit && compinit"}
|
||||||
${optionalString cfg.enableBashCompletion "autoload -U bashcompinit && bashcompinit"}
|
${optionalString cfg.enableBashCompletion "autoload -U bashcompinit && bashcompinit"}
|
||||||
|
|
||||||
|
@ -194,9 +193,9 @@ in
|
||||||
"source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
|
"source ${pkgs.zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
|
||||||
}
|
}
|
||||||
|
|
||||||
${cfg.promptInit}
|
${optionalString cfg.enableFzfCompletion "source ${fzfCompletion}"}
|
||||||
|
${optionalString cfg.enableFzfGit "source ${fzfGit}"}
|
||||||
if test -n "$IN_NIX_SHELL"; then PS1='%F{green}%B[nix-shell:%~]%#%b%f '; fi
|
${optionalString cfg.enableFzfHistory "source ${fzfHistory}"}
|
||||||
|
|
||||||
# Read system-wide modifications.
|
# Read system-wide modifications.
|
||||||
if test -f /etc/zshrc.local; then
|
if test -f /etc/zshrc.local; then
|
||||||
|
|
Loading…
Add table
Reference in a new issue