dotnix/modules/home/zsh/default.nix
2025-03-29 19:05:05 +01:00

52 lines
1.4 KiB
Nix

{ profile, pkgs, lib, ... }:
{
imports = [
./zshrc-personal.nix
];
programs.zsh = {
enable = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
oh-my-zsh = {
enable = true;
};
plugins = [
{
name = "powerlevel10k";
src = pkgs.zsh-powerlevel10k;
file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
}
{
name = "powerlevel10k-config";
src = lib.cleanSource ./p10k-config;
file = "p10k.zsh";
}
];
initExtra = ''
bindkey "\eh" backward-word
bindkey "\ej" down-line-or-history
bindkey "\ek" up-line-or-history
bindkey "\el" forward-word
if [ -f $HOME/.zshrc-personal ]; then
source $HOME/.zshrc-personal
fi
'';
shellAliases = {
ncg = "nix-collect-garbage --delete-old && sudo nix-collect-garbage -d && sudo /run/current-system/bin/switch-to-configuration boot";
cat = "bat";
man = "batman";
ls = "eza --icons --group-directories-first -1";
ll = "eza --icons -lh --group-directories-first -1 --no-user --long";
la = "eza --icons -lah --group-directories-first -1";
tree = "eza --icons --tree --group-directories-first";
fr = "rm -f ~/.config/mimeapps.list.backup && nh os switch --hostname ${profile}";
fu = "nh os switch --hostname ${profile} --update";
};
};
}