146 lines
3.8 KiB
Nix
146 lines
3.8 KiB
Nix
{
|
|
pkgs,
|
|
config,
|
|
...
|
|
}: {
|
|
# export some defaults
|
|
home.sessionVariables = {
|
|
EDITOR = "nvim";
|
|
PAGER = "less";
|
|
};
|
|
|
|
programs.zsh = {
|
|
enable = true;
|
|
dotDir = ".config/zsh";
|
|
autocd = true;
|
|
enableCompletion = true;
|
|
|
|
autosuggestion = {
|
|
enable = true;
|
|
highlight = "underline";
|
|
};
|
|
|
|
history = {
|
|
size = 10000;
|
|
save = 10000;
|
|
share = true;
|
|
append = true;
|
|
extended = true;
|
|
path = "$XDG_STATE_HOME/zsh/history";
|
|
};
|
|
|
|
shellAliases = {
|
|
# --- zsh ---
|
|
cfz = "nvim $HOME/.config/zsh/.zshrc";
|
|
src = "source $HOME/.config/zsh/.zshrc";
|
|
|
|
# --- config editing ---
|
|
cfh = "nvim $HOME/.config/hypr/hyprland.conf";
|
|
cfl = "nvim $HOME/.config/lf/lfrc";
|
|
|
|
# --- navigation ---
|
|
ls = "ls --color=auto --group-directories-first";
|
|
ll = "ls -lh --color=auto --group-directories-first";
|
|
la = "ls -Alh --color=auto --group-directories-first";
|
|
".." = "cd ..";
|
|
"..." = "cd ../..";
|
|
fs = "du -h | sort -h";
|
|
ds = "du -hs";
|
|
|
|
# --- shortcuts ---
|
|
vswap = "cd ~/.local/state/nvim/swap";
|
|
rswap = "rm ~/.local/state/nvim/swap/*";
|
|
v = "nvim";
|
|
sv = "sudo nvim";
|
|
vim = "nvim";
|
|
|
|
# --- safety ---
|
|
cp = "cp -iv";
|
|
mv = "mv -iv";
|
|
rm = "rm -Iv";
|
|
|
|
# --- colors ---
|
|
grep = "grep --color=auto";
|
|
fgrep = "fgrep --color=auto";
|
|
egrep = "egrep --color=auto";
|
|
|
|
# --- scripts ---
|
|
rebuild = "sh ~/.nix/bin/rebuild.sh";
|
|
perms = "sudo sh ~/.nix/bin/perms.sh";
|
|
bb = "sudo sh ~/.nix/bin/lf_borg.sh";
|
|
|
|
# --- git ---
|
|
status = "git status";
|
|
add = "git add";
|
|
commit = "git commit -am";
|
|
push = "git push";
|
|
pull = "git pull";
|
|
dotfiles = "/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME";
|
|
dtf = "/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME";
|
|
sec = "sops ~/.nix/secrets/secrets.yaml";
|
|
|
|
# --- systemd ---
|
|
stat = "sudo systemctl status";
|
|
restart = "sudo systemctl restart";
|
|
start = "sudo systemctl start";
|
|
stop = "sudo systemctl stop";
|
|
jou = "sudo journalctl -xeu";
|
|
live = "sudo journalctl -o short-iso -n 50 -fu";
|
|
|
|
# --- system ---
|
|
peace = "systemctl poweroff";
|
|
love = "systemctl reboot";
|
|
lock = "loginctl lock-session";
|
|
};
|
|
|
|
initContent = ''
|
|
|
|
# the prompt
|
|
PS1='%F{0}%K{126}%B[%n@%m]%b%k%f:%F{015}%B[%~]%b%f%F{015}%S$%s%f '
|
|
|
|
# lf changes working dir on exit
|
|
alias lf='lfcd'
|
|
lfcd () {cd "$(command lf -print-last-dir "$@")"}
|
|
|
|
'';
|
|
|
|
syntaxHighlighting = {
|
|
enable = true;
|
|
highlighters = ["main" "brackets" "pattern" "regexp" "cursor" "root"];
|
|
styles = {
|
|
"default" = "none";
|
|
"unknown-token" = "fg=red";
|
|
"reserved-word" = "fg=red";
|
|
"alias" = "fg=cyan,underline";
|
|
"suffix-alias" = "fg=cyan,underline";
|
|
"builtin" = "fg=cyan";
|
|
"function" = "fg=cyan";
|
|
"command" = "fg=cyan,bold";
|
|
"path" = "fg=cyan,underline";
|
|
"precommand" = "fg=cyan,underline";
|
|
"commandseparator" = "fg=white";
|
|
"globbing" = "fg=white";
|
|
"history-expansion" = "fg=white";
|
|
"hashed-command" = "fg=magenta";
|
|
"single-hyphen-option" = "fg=blue";
|
|
"double-hyphen-option" = "fg=blue";
|
|
"back-quoted-argument" = "fg=yellow";
|
|
"single-quoted-argument" = "fg=white";
|
|
"double-quoted-argument" = "fg=white";
|
|
"dollar-double-quoted-argument" = "fg=blue";
|
|
"back-double-quoted-argument" = "fg=blue";
|
|
};
|
|
};
|
|
|
|
# zplug = {
|
|
# enable = true;
|
|
# zplugHome = "$XDG_STATE_HOME/zsh/zplug";
|
|
# plugins = [
|
|
# {name = "zsh-users/zsh-syntax-highlighting";}
|
|
# ];
|
|
# };
|
|
};
|
|
# rid the world of ~/.zshenv
|
|
#home.file.".zshenv".enable = false;
|
|
}
|