nixos-config/modules/shell/zsh.nix

44 lines
1.2 KiB
Nix

#
# Shell
#
{ pkgs, ... }:
{
programs = {
zsh = {
enable = true;
dotDir = ".config/zsh_nix";
autosuggestion.enable = true; # Auto suggest options and highlights syntact, searches in history for options
syntaxHighlighting.enable = true;
history.size = 10000;
oh-my-zsh = { # Extra plugins for zsh
enable = true;
plugins = [ "git" ];
custom = "$HOME/.config/zsh_nix/custom";
};
initExtraFirst = '' # very first inits in zshrc
if [[ $DISPLAY ]]; then
[[ $- != *i* ]] && return
[[ -z "$TMUX" ]] && (tmux attach || tmux new-session)
fi
'';
initExtra = '' # Zsh theme
# 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
eval "$(direnv hook zsh)"
eval "$(ssh-agent)"
'';
};
};
}