diff --git a/hosts/pinwheel/modules/zsh/default.nix b/hosts/pinwheel/modules/zsh/default.nix index 2370918..31106db 100644 --- a/hosts/pinwheel/modules/zsh/default.nix +++ b/hosts/pinwheel/modules/zsh/default.nix @@ -54,6 +54,20 @@ in "bindkey -v '^?' backward-delete-char" "bindkey '^a' beginning-of-line" "bindkey '^e' end-of-line" + '' + function prompt_in_nix_shell() { + if [[ -n "$IN_NIX_SHELL" ]]; then + p10k segment -f yellow -t "nix"; + fi + } + '' + '' + function prompt_in_direnv() { + if [[ -n "$DIRENV_DIR" ]]; then + p10k segment -f yellow -t "direnv" + fi + } + '' ]; }; }; diff --git a/hosts/pinwheel/modules/zsh/p10k-config/p10k.zsh b/hosts/pinwheel/modules/zsh/p10k-config/p10k.zsh index ec1e075..dfd53cf 100644 --- a/hosts/pinwheel/modules/zsh/p10k-config/p10k.zsh +++ b/hosts/pinwheel/modules/zsh/p10k-config/p10k.zsh @@ -54,6 +54,8 @@ command_execution_time # previous command duration virtualenv # python virtual environment prompt_char # prompt symbol + in_nix_shell + in_direnv ) # Right prompt segments.