nixos/user/zsh/default.nix

61 lines
2.0 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-09-13 16:42:10 +00:00
nclean = ''
sudo nix-channel --update
sudo nix-env -u --always
sudo rm /nix/var/nix/gcroots/auto/*
sudo nix-collect-garbage -d
'';
2024-07-24 06:33:32 +00:00
nrebuild = "nix flake update /home/mbeno/git/nixos && sudo nixos-rebuild switch --recreate-lock-file --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 = ''
2024-09-13 16:42:10 +00:00
set --unexport COLUMNS
set --unexport LINES
2024-03-18 11:58:34 +00:00
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
};
}