65 lines
1.2 KiB
Nix
65 lines
1.2 KiB
Nix
{
|
|
pkgs,
|
|
lib,
|
|
config,
|
|
...
|
|
}: let
|
|
inherit (lib) mkEnableOption mkIf;
|
|
cfg = config.my.zsh;
|
|
in {
|
|
options.my.zsh = {
|
|
enable = mkEnableOption "zsh";
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
programs.zsh = {
|
|
enable = true;
|
|
|
|
autosuggestion.enable = true;
|
|
syntaxHighlighting.enable = true;
|
|
historySubstringSearch.enable = true;
|
|
autocd = true;
|
|
enableCompletion = true;
|
|
|
|
# Enable pure prompt
|
|
initExtra = ''
|
|
fpath+=${pkgs.pure-prompt}/share/zsh/site-functions
|
|
autoload -U promptinit;
|
|
promptinit
|
|
prompt pure
|
|
'';
|
|
|
|
envExtra = ''
|
|
# Do not load global configuration
|
|
setopt no_global_rcs
|
|
'';
|
|
|
|
loginExtra = ''
|
|
setopt correct
|
|
'';
|
|
|
|
sessionVariables = {
|
|
# Make ls colorful on MacOS
|
|
CLICOLOR = 1;
|
|
};
|
|
|
|
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";
|
|
};
|
|
}
|
|
];
|
|
};
|
|
|
|
programs.zoxide = {
|
|
enable = true;
|
|
};
|
|
};
|
|
}
|