nixos/user/zsh/default.nix

71 lines
2.7 KiB
Nix
Raw Normal View History

2024-07-07 23:16:41 +02:00
{ user, pkgs, config, ... }: {
2024-03-18 12:58:34 +01:00
home.packages = with pkgs; [ fd ];
programs.zsh = {
enable = true;
autocd = false;
2024-04-21 06:49:09 +02:00
autosuggestion.enable = true;
2024-03-18 12:58:34 +01:00
enableCompletion = true;
syntaxHighlighting.enable = true;
shellAliases = {
2024-09-13 18:42:10 +02: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-03 11:08:44 +01:00
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'";
2024-07-07 23:16:41 +02: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-11-15 11:24:09 +01:00
dresden = "/home/mbeno/.ssh/dresden.sh dresden";
father = "/home/mbeno/.ssh/dresden.sh father";
father-old = "/home/mbeno/.ssh/dresden.sh father-old";
2024-03-18 15:50:29 +01:00
d = "dresden";
2024-11-15 11:24:09 +01:00
view-tsd = "vmware-view --serverURL=view.tsd.usit.no --userName=p01-mbeno --passcode=\"$(rbw get -f 'TOTP' p01-mbeno)\" --password=\"$(rbw get p01-mbeno)\" --tokenUserName=p01-mbeno --domainName=tsd.usit.no --nonInteractive --kbdLayout=en-us";
2024-09-13 19:00:41 +02:00
alien = "nix run --impure github:guibou/nixGL --override-input nixpkgs nixpkgs/nixos-unstable -- nix run github:thiagokokada/nix-alien --";
2024-11-15 11:24:09 +01:00
win = "sudo bootctl set-oneshot auto-windows && reboot";
2024-03-18 12:58:34 +01:00
};
2024-04-19 12:31:32 +02:00
2024-03-18 12:58:34 +01:00
initExtra = ''
2024-09-13 18:42:10 +02:00
set --unexport COLUMNS
set --unexport LINES
2024-03-18 12:58:34 +01:00
bindkey -v
bindkey '^R' history-incremental-search-backward
2024-07-07 23:16:41 +02:00
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
2024-03-18 12:58:34 +01:00
# Prompt stuff
autoload -Uz promptinit
promptinit
2024-03-18 14:09:49 +01:00
prompt agnoster
2024-04-19 12:31:32 +02:00
source ~/.config/source/tsd-artifacts
2024-03-18 12:58:34 +01:00
'';
zplug = {
enable = true;
plugins = [
2024-07-07 23:16:41 +02: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 12:58:34 +01:00
];
};
2024-11-03 11:15:59 +01:00
history.size = 100000000;
2024-07-07 23:16:41 +02:00
history.path = "${config.xdg.dataHome}/zsh/history";
2024-11-03 11:15:59 +01:00
history.share = true;
historySubstringSearch.enable = true;
2024-03-18 12:58:34 +01:00
};
}