Files
nix/modules/home/zsh/default.nix

47 lines
1.1 KiB
Nix

{ username, pkgs, ... }:
{
programs = {
zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
shellAliases = {
la = "ls -la";
ll = "ls -l";
"nixos-switch" = "sudo nixos-rebuild switch --flake /home/${username}/.nix";
f = "fuck";
};
history.size = 10000;
history.ignoreAllDups = true;
history.path = "$HOME/.zsh_history";
# history.ignorePatterns = [ "rm *" "pkill *" "cp *" ];
oh-my-zsh = {
enable = true;
plugins = [ "git" "sudo" "docker" "docker-compose" ];
};
plugins = [
{
name = "powerlevel10k";
src = pkgs.zsh-powerlevel10k;
file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
}
{
name = "powerlevel10k-config";
src = ./powerlevel10k;
file = "p10k.zsh";
}
];
};
thefuck = {
enable = true;
enableZshIntegration = true; # 自动为 Zsh 设置别名 (通常是 'fuck')
};
};
}