nixos/user/zsh/default.nix

62 lines
2.1 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-11-02 11:11:30 +00:00
nrebuild = "git -C /home/mbeno/git/nixos add --all; git -C /home/mbeno/git/nixos commit -m'lol'; nix flake update --flake /home/mbeno/git/nixos && sudo nixos-rebuild switch --flake /home/mbeno/git/nixos && 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-09-13 17:00:41 +00:00
alien = "nix run --impure github:guibou/nixGL --override-input nixpkgs nixpkgs/nixos-unstable -- nix run github:thiagokokada/nix-alien --";
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
};
}