nix-configs/modules/zsh.nix

80 lines
2.4 KiB
Nix
Raw Normal View History

2022-09-02 15:07:30 +00:00
{ config, lib, pkgs, ... }:
let cfg = config.jade.zsh;
in with lib; {
options.jade.zsh = {
enable = mkEnableOption "Enable zsh";
};
config = mkIf cfg.enable {
home-manager.users.jade = { pkgs,... } : {
2022-09-02 15:11:45 +00:00
home.packages = with pkgs; [
thefuck
];
2022-09-02 15:07:30 +00:00
programs.zsh = {
enable = true;
enableAutosuggestions = true;
enableSyntaxHighlighting = true;
autocd = true;
defaultKeymap = "viins";
dotDir = ".config/zsh";
history = {
extended = true;
save = 100000;
size = 100000;
};
shellAliases = {
sudo = "sudo ";
2022-09-02 15:10:50 +00:00
v = "nvim";
2022-09-02 15:07:30 +00:00
termsize = "echo \"width: $(tput cols)\nheight: $(tput lines)\"";
batstate = "echo \"Charge state: $(cat /sys/class/power_supply/BAT0/capacity)%\"";
clear = "clear;neofetch";
bdin = "betterdiscordctl install && killall Discord && Discord & disown";
upg = "paru -Syu --skipreview --noconfirm && flatpak upgrade && rustup upgrade";
grepo = "cd $HOME/Documents/repos && ls";
2022-09-02 16:21:58 +00:00
gnix = "cd $HOME/nix-configs";
2022-09-02 15:07:30 +00:00
slol = "while true;do \\clear;sl --help | lolcat;done;";
# localhost.run
lhr = "ssh -R 80:localhost:8080 nokey@localhost.run";
sshrpi = "ssh jade@192.168.178.111";
# cargo
cr = "cargo run";
cb = "cargo build";
cf = "cargo fmt";
cfx = "cargo fix";
cl = "cargo clippy";
cbr = "cargo build --release";
# fucking around
2022-09-02 15:09:22 +00:00
"" = "nvim";
2022-09-02 15:07:30 +00:00
};
oh-my-zsh = {
enable = true;
plugins = [
"git" "sudo" "colored-man-pages" "zsh-interactive-cd" "branch"
"colorize" "command-not-found" "common-aliases" "rsync" "rust"
"thefuck"
];
theme = "fox";
};
initExtra = ''
# file endings
alias -s {pdf,PDF}="evince"
alias -s {jpg,JPG,png,PNG}="kitty +kitten icat"
alias -s {ods,ODS,odt,ODT,odp,ODP,doc,DOC,docx,DOCX,xls,XLS,xlsx,XLSX,xlsm,XLSM,ppt,PPT,pptx,PPTX,csv,CSV}='libreoffice'
alias -s {html,HTML}="librewolf"
alias -s {mp4,MP4,mov,MOV,mkv,MKV}='vlc'
alias -s {zip,ZIP,war,WAR}="unzip -l"
alias -s {jar,JAR}="java -jar"
alias -s gz="tar -tf"
alias -s {tgz,TGZ}="tar -tf"
'';
};
};
};
}