caenix/modules/home/caem/core/zsh/default.nix
2025-02-20 22:25:37 +01:00

87 lines
1.8 KiB
Nix

{ pkgs, config, ... }:
{
home.packages = with pkgs; [
lsd
bat
fd
ripgrep
fzf
tre-command
btop
zsh-completions
nix-zsh-completions
];
programs.bat = {
enable = true;
config = {
theme = "ansi";
};
};
programs.btop = {
enable = true;
settings = {
color_theme = "TTY";
};
};
home.file.".zshenv".enable = false;
home.file.".config/zsh/conf.d" = {
source = ./conf.d;
recursive = true;
};
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
dotDir = ".config/zsh";
autocd = true;
history.size = 10000;
history.ignoreAllDups = true;
/* Not persisted on purpose */
history.path = "${config.xdg.cacheHome}/zsh_history";
shellAliases = {
cat = "bat --paging=never --wrap=never --style='changes,snip,numbers'";
ls = "lsd";
tree = "tre";
};
initExtra = ''
alias -g -- -h='-h 2>&1 | bat --language=help --style=plain'
alias -g -- --help='--help 2>&1 | bat --language=help --style=plain'
for dotfile in "$ZDOTDIR/conf.d/"*; do
source "$dotfile"
done
'';
plugins = [
{
name = "zsh-nix-shell";
file = "nix-shell.plugin.zsh";
src = pkgs.fetchFromGitHub {
owner = "chisui";
repo = "zsh-nix-shell";
rev = "v0.8.0";
sha256 = "1lzrn0n4fxfcgg65v0qhnj7wnybybqzs4adz7xsrkgmcsr0ii8b7";
};
}
{
name = "fzf-tab";
file = "fzf-tab.plugin.zsh";
src = pkgs.fetchFromGitHub {
owner = "Aloxaf";
repo = "fzf-tab";
rev = "v1.2.0";
sha256 = "sha256-q26XVS/LcyZPRqDNwKKA9exgBByE0muyuNb0Bbar2lY=";
};
}
];
};
}