nixos/user/zsh/default.nix
2024-11-03 11:08:44 +01:00

66 lines
2.3 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 = {
nclean = ''
sudo nix-channel --update
sudo nix-env -u --always
sudo rm /nix/var/nix/gcroots/auto/*
sudo nix-collect-garbage -d
'';
nreb = "nix flake update --flake /home/mbeno/git/nixos && sudo nixos-rebuild switch --flake /home/mbeno/git/nixos && source ~/.zshrc";
nbo = "nix flake update --flake /home/mbeno/git/nixos && sudo nixos-rebuild boot --flake /home/mbeno/git/nixos && reboot";
ncom = "git -C /home/mbeno/git/nixos add --all && git -C /home/mbeno/git/nixos commit -m'lol'";
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";
alien = "nix run --impure github:guibou/nixGL --override-input nixpkgs nixpkgs/nixos-unstable -- nix run github:thiagokokada/nix-alien --";
};
initExtra = ''
set --unexport COLUMNS
set --unexport LINES
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";
histSize = 1000000;
histFile = "${config.xdg.dataHome}/zsh/history2";
};
}