nixos/user/zsh/default.nix
2024-07-24 07:11:35 +02:00

53 lines
1.7 KiB
Nix

{ user, pkgs, config, ... }: {
home.packages = with pkgs; [ fd ];
programs.zsh = {
enable = true;
autocd = false;
autosuggestion.enable = true;
enableCompletion = true;
syntaxHighlighting.enable = true;
shellAliases = {
nrebuild = "nix flake update /home/mbeno/git/nixos && sudo nixos-rebuild switch --flake /home/${user}/git/nixos && nvd diff $(ls -d1v /nix/var/nix/profiles/system-*-link|tail -n 2) && source ~/.zshrc";
nlog = ''
revpath="/nix/var/nix/profiles";
lastrev=$(ls -d1v $revpath/system-*-link|cut -d "-" -f2 | tail -n1);
for revit in {$lastrev..0};
do
ls -lt $revpath/system-$revit-link $revpath/system-$(( $revit - 1 ))-link | cut -d" " -f6,7,8 | awk '{key=$0; getline; print key " -> " $0;}'
nvd diff $revpath/system-$revit-link $revpath/system-$(( $revit - 1 ))-link;
read;
done
'';
dresden = "/home/mbeno/.ssh/dresden.sh";
d = "dresden";
};
initExtra = ''
bindkey -v
bindkey '^R' history-incremental-search-backward
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
# Prompt stuff
autoload -Uz promptinit
promptinit
prompt agnoster
source ~/.config/source/tsd-artifacts
'';
zplug = {
enable = true;
plugins = [
{ name = "plugins/git"; tags = [ "from:oh-my-zsh" ]; }
{ name = "modules/prompt"; tags = [ "from:prezto" ]; }
{ name = "zsh-users/zsh-autosuggestions"; }
{
name =
"zsh-users/zsh-history-substring-search";
}
];
};
history.size = 1000000;
history.path = "${config.xdg.dataHome}/zsh/history";
};
}