1
0
Fork 0
forked from foxora/nix
flake-foxora/homes/modules/shell/zsh.nix
2026-02-12 18:53:24 +00:00

86 lines
2.1 KiB
Nix

{ inputs, lib, pkgs, ... }:
let
unstable = inputs.nixpkgs-unstable.legacyPackages.${pkgs.stdenv.hostPlatform.system};
in
{
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
plugins = [
{
name = "vi-mode";
src = pkgs.zsh-vi-mode;
file = "share/zsh-vi-mode/zsh-vi-mode.plugin.zsh";
}
];
initContent = ''
# yazi wrapper!!!
function yazi() {
local tmp="$(mktemp -p "/run/user/$UID" -t "yazi-cwd.XXXXXX")" cwd
command yazi "$@" --cwd-file="$tmp"
IFS= read -r -d ''' cwd < "$tmp"
[ -n "$cwd" ] && [ "$cwd" != "$PWD" ] && builtin cd -- "$cwd"
rm -f -- "$tmp"
}
hyfetch # oh i'm so gay!! :3
'';
shellAliases = {
# files and nav stuff
ls = "eza";
ll = "ls -la";
lt = "ls --tree";
llt = "ll --tree";
y = "yazi";
# cat with wings!!!
cat = "bat";
# init github keys
# description: gi = github initialize
sa = "eval \"$(ssh-agent -s)\"";
gh-auv = "ssh-add ~/.ssh/github_auroraveon";
cb-fox = "ssh-add ~/.ssh/codeberg_foxxyora";
# --------------------
# shorthand nix command aliases
# open nix develop with preferred shell
# description: nd = nix develop
nd = "nix develop -c $SHELL";
# description: cdns = change directory [to] nix settings
cdns = "cd /etc/nixos";
# cd to /etc/nixos and edit nix config
# description: ns = nix settings
ns = "cdns && sudo -E -s $EDITOR";
# description: nrs = nix rebuild switch
nrs = "cdns && nh os switch /etc/nixos";
# upgrades the system
upgrade = "cdns && sudo nix flake update && nh os switch /etc/nixos";
# kitty's ssh command (to fix xterm and other stuff qwq)
kssh = "kitty +kitten ssh";
# pipes are prettyyyy!!!! :3333
pipes1 = "pipes.sh -r 1024 -p 8 -f 30";
pipes2 = "pipes.sh -r 4096 -p 16 -f 100";
};
history = {
size = 16384;
};
};
programs.zsh.oh-my-zsh = {
enable = true;
theme = "agnoster";
};
}