feat: set zsh config to mine (mostly)

This commit is contained in:
Ahwx 2024-06-21 09:40:23 +02:00
parent 99954a97f1
commit 382d4c34d8

View file

@ -1,74 +1,98 @@
{ hostname, config, pkgs, host, ...}:
{
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
oh-my-zsh = {
programs = {
zsh = {
enable = true;
plugins = [ "git" "fzf" ];
autocd = true;
autosuggestion.enable = true;
enableCompletion = true;
localVariables = {
# Looks like this: '~/some/path > '
PS1 = "%F{magenta}%~%f > ";
# Gets pushed to the home directory otherwise
LESSHISTFILE = "/dev/null";
# Make Vi mode transitions faster (in hundredths of a second)
# KEYTIMEOUT = 1;
LANG = "en_US.UTF-8";
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=#808080";
};
shellAliases = {
ls = "eza -lh";
la = "eza -A";
ll = "eza -l";
lla = "eza -lA";
# :q = "exit";
ezit = "exit";
notes = "nvim ~/Documents/todo.md";
todo = "nvim ~/Documents/todo.md";
irc = "ssh irc";
tmuxconf = "nvim ~/.config/tmux/tmux.conf";
nvimconf = "cd ~/.config/nvim && nvim";
termconf = "nvim ~/.config/alacritty/alacritty.yml";
wc = "wl-copy";
zshrc = "nvim ~/.zshrc";
yt-dlp-audio = "yt-dlp -f 'ba' -x --audio-format mp3";
emerge = "doas emerge";
zshconf = "nvim ~/.zshrc";
open = "xdg-open";
tree = "eza --icons --tree --group-directories-first";
nvim = "nix run /home/liv/Development/nixvim --";
doas = "sudo";
# NixOS
cdnix = "cd ~/nixos-config && codium ~/nixos-config";
ns = "nix-shell --run zsh";
nix-shell = "nix-shell --run zsh";
nix-switch = "sudo nixos-rebuild switch --flake ~/nixos-config#${host}";
nix-switchu = "sudo nixos-rebuild switch --upgrade --flake ~/nixos-config#${host}";
nix-flake-update = "sudo nix flake update ~/nixos-config#";
nix-clean = "sudo nix-collect-garbage && sudo nix-collect-garbage -d && sudo rm /nix/var/nix/gcroots/auto/* && nix-collect-garbage && nix-collect-garbage -d";
};
plugins = with pkgs; [
{
name = "zsh-syntax-highlighting";
src = fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-syntax-highlighting";
rev = "0.6.0";
sha256 = "0zmq66dzasmr5pwribyh4kbkk23jxbpdw4rjxx0i7dx8jjp2lzl4";
};
file = "zsh-syntax-highlighting.zsh";
}
{
name = "zsh-abbr";
src = fetchFromGitHub {
owner = "olets";
repo = "zsh-abbr";
rev = "752e9fcc4daff680545c30f8f857913d66f6f5e6";
sha256 = "sha256-HY/F43fpWn1PBYb2c+qp0CyF3hpSFHUZdZLZRS1d9Yc=";
};
file = "zsh-abbr.sh";
}
{
name = "zsh-autopair";
src = fetchFromGitHub {
owner = "hlissner";
repo = "zsh-autopair";
rev = "34a8bca0c18fcf3ab1561caef9790abffc1d3d49";
sha256 = "1h0vm2dgrmb8i2pvsgis3lshc5b0ad846836m62y8h3rdb3zmpy1";
};
file = "autopair.zsh";
}
];
};
initExtraFirst = ''
DISABLE_MAGIC_FUNCTIONS=true
export "MICRO_TRUECOLOR=1"
'';
shellAliases = {
# record = "wf-recorder --audio=alsa_output.pci-0000_08_00.6.analog-stereo.monitor -f $HOME/Videos/$(date +'%Y%m%d%H%M%S_1.mp4')";
# Utils
c = "clear";
cd = "z";
tt = "gtrash put";
cat = "bat";
nano = "micro";
code = "codium";
py = "python";
icat = "kitten icat";
dsize = "du -hs";
findw = "grep -rl";
fzf = {
enable = true;
enableZshIntegration = true;
};
l = "eza --icons -a --group-directories-first -1"; #EZA_ICON_SPACING=2
ll = "eza --icons -a --group-directories-first -1 --no-user --long";
tree = "eza --icons --tree --group-directories-first";
# Nixos
cdnix = "cd ~/nixos-config && codium ~/nixos-config";
ns = "nix-shell --run zsh";
nix-shell = "nix-shell --run zsh";
nix-switch = "sudo nixos-rebuild switch --flake ~/nixos-config#${host}";
nix-switchu = "sudo nixos-rebuild switch --upgrade --flake ~/nixos-config#${host}";
nix-flake-update = "sudo nix flake update ~/nixos-config#";
nix-clean = "sudo nix-collect-garbage && sudo nix-collect-garbage -d && sudo rm /nix/var/nix/gcroots/auto/* && nix-collect-garbage && nix-collect-garbage -d";
# Git
ga = "git add";
gaa = "git add --all";
gs = "git status";
gb = "git branch";
gm = "git merge";
gpl = "git pull";
gplo = "git pull origin";
gps = "git push";
gpst = "git push --follow-tags";
gpso = "git push origin";
gc = "git commit";
gcm = "git commit -m";
gcma = "git add --all && git commit -m";
gtag = "git tag -ma";
gch = "git checkout";
gchb = "git checkout -b";
gcoe = "git config user.email";
gcon = "git config user.name";
# python
piv = "python -m venv .venv";
psv = "source .venv/bin/activate";
zoxide = {
enable = true;
enableZshIntegration = true;
};
};
programs.zoxide = {
enable = true;
enableZshIntegration = true;
};
}