nixos-config/modules/shell/zsh.nix

47 lines
1.4 KiB
Nix
Raw Normal View History

2022-09-17 16:50:50 +02:00
#
# Shell
#
{ pkgs, ... }:
{
programs = {
zsh = {
enable = true;
dotDir = ".config/zsh_nix";
enableAutosuggestions = true; # Auto suggest options and highlights syntact, searches in history for options
2023-06-30 13:29:07 +02:00
syntaxHighlighting.enable = true;
2022-09-17 16:50:50 +02:00
history.size = 10000;
oh-my-zsh = { # Extra plugins for zsh
enable = true;
plugins = [ "git" ];
custom = "$HOME/.config/zsh_nix/custom";
};
2022-10-09 14:01:59 +02:00
initExtraFirst = '' # very first inits in zshrc
2022-10-09 10:35:54 +02:00
if [[ $DISPLAY ]]; then
[[ $- != *i* ]] && return
2022-10-16 09:48:51 +02:00
[[ -z "$TMUX" ]] && (tmux attach || tmux new-session)
2022-10-09 10:35:54 +02:00
fi
2022-10-09 14:01:59 +02:00
'';
initExtra = '' # Zsh theme
export GPG_TTY=$(tty)
gpg-connect-agent updatestartuptty /bye >/dev/null
unset SSH_AGENT_PID
export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh"
2022-09-17 16:50:50 +02:00
# Spaceship
source ${pkgs.spaceship-prompt}/share/zsh/site-functions/prompt_spaceship_setup
autoload -U promptinit; promptinit
# source $HOME/.config/shell/shell_init
# Hook direnv
# emulate zsh -c "$(direnv hook zsh)"
# Swag
pfetch # Show fetch logo on terminal start
2023-07-07 10:57:02 +02:00
eval "$(direnv hook zsh)"
2022-09-17 16:50:50 +02:00
'';
};
};
}