nixos/user/zsh/default.nix

53 lines
1.7 KiB
Nix
Raw Normal View History

2024-07-07 21:16:41 +00:00
{ user, pkgs, config, ... }: {
2024-03-18 11:58:34 +00:00
home.packages = with pkgs; [ fd ];
programs.zsh = {
enable = true;
autocd = false;
2024-04-21 04:49:09 +00:00
autosuggestion.enable = true;
2024-03-18 11:58:34 +00:00
enableCompletion = true;
syntaxHighlighting.enable = true;
shellAliases = {
2024-07-24 05:11:35 +00:00
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";
2024-07-07 21:16:41 +00:00
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
'';
2024-03-18 14:50:29 +00:00
dresden = "/home/mbeno/.ssh/dresden.sh";
d = "dresden";
2024-03-18 11:58:34 +00:00
};
2024-04-19 10:31:32 +00:00
2024-03-18 11:58:34 +00:00
initExtra = ''
bindkey -v
bindkey '^R' history-incremental-search-backward
2024-07-07 21:16:41 +00:00
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
2024-03-18 11:58:34 +00:00
# Prompt stuff
autoload -Uz promptinit
promptinit
2024-03-18 13:09:49 +00:00
prompt agnoster
2024-04-19 10:31:32 +00:00
source ~/.config/source/tsd-artifacts
2024-03-18 11:58:34 +00:00
'';
zplug = {
enable = true;
plugins = [
2024-07-07 21:16:41 +00:00
{ 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";
}
2024-03-18 11:58:34 +00:00
];
};
2024-07-07 21:16:41 +00:00
history.size = 1000000;
history.path = "${config.xdg.dataHome}/zsh/history";
2024-03-18 11:58:34 +00:00
};
}