nix/modules/home-manager/cli/zsh/default.nix

76 lines
2 KiB
Nix

{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.cli.zsh;
in
{
options.modules.cli.zsh = {
enable = mkEnableOption "enable Zsh configuration";
};
config = mkIf cfg.enable {
programs.zsh = {
enable = true;
dotDir = ".config/zsh";
defaultKeymap = "viins";
enableCompletion = true;
history = {
ignoreAllDups = true;
save = 10000;
share = true;
path = "$HOME/.local/share/zsh/history";
};
historySubstringSearch = {
enable = true;
searchDownKey = "^[OB";
searchUpKey = "^[OA";
};
completionInit = ''
autoload -Uz compinit
for dump in ''${ZDOTDIR}/.zcompdump(N.mh+24); do
compinit
done
compinit -C
'';
plugins = [
{
name = "pure";
src = pkgs.fetchFromGitHub {
owner = "sindresorhus";
repo = "pure";
rev = "v1.22.0";
hash = "sha256-TR4CyBZ+KoZRs9XDmWE5lJuUXXU1J8E2Z63nt+FS+5w=";
};
}
{
name = "base16-shell";
src = pkgs.fetchFromGitHub {
owner = "chriskempson";
repo = "base16-shell";
rev = "588691ba71b47e75793ed9edfcfaa058326a6f41";
hash = "sha256-X89FsG9QICDw3jZvOCB/KsPBVOLUeE7xN3VCtf0DD3E=";
};
}
{
name = "fast-syntax-highlighting";
src = pkgs.fetchFromGitHub {
owner = "zdharma-continuum";
repo = "fast-syntax-highlighting";
rev = "v1.55";
hash = "sha256-DWVFBoICroKaKgByLmDEo4O+xo6eA8YO792g8t8R7kA=";
};
}
{
name = "history-search-multi-word";
src = pkgs.fetchFromGitHub {
owner = "zdharma-continuum";
repo = "history-search-multi-word";
rev = "c4dcddc1cd17e7e0909471703f3526170db0f475";
hash = "sha256-KgKm9qzFnwXDXwmTruPgC0tjmiTY5AiGdrWW4zDWUF4=";
};
}];
localVariables = {
BASE16_THEME = "$HOME/.config/zsh/plugins/base16";
};
};
};
}