{ config, pkgs, self, ... }: { programs.zsh = { enable = true; syntaxHighlighting.enable = true; autosuggestion.enable = true; enableCompletion = true; autocd = true; dotDir = ".config/zsh"; history = { path = "${config.xdg.stateHome}/zsh/zsh_history"; ignoreSpace = false; save = 90000; size = 90000; }; historySubstringSearch.enable = true; sessionVariables = { WALLPAPER = "${self}/files/wallpaper.jpg"; }; shellAliases = { vim = "nvim"; ls = "lsd"; l = "ls -l"; la = "ls -a"; lla = "ls -la"; lt = "ls --tree"; rebackup = "restic -r /mnt/storage/backups --password-file ~/srv/restic_pswd backup"; repreconf = "restic -r /mnt/storage/backups --password-file ~/srv/restic_pswd"; b-del = "sudo btrfs subv delet /srv/snapshots/home"; b-shot = "sudo btrfs subvolume snapshot -r /home /srv/snapshots/home"; b-home = ''[ -d /srv/snapshots/home ] && sudo btrfs subvolume delete /srv/snapshots/home; sudo btrfs subvolume snapshot -r /home /srv/snapshots/home; sudo restic -r /mnt/storage/backups --password-file ~/srv/restic_pswd --cache-dir /srv/.restic-cache backup /srv/snapshots/home;''; r-clean = '' sudo restic -r /mnt/storage/backups --password-file ~/srv/restic_pswd --cache-dir /srv/.restic-cache forget \ --keep-weekly 7 \ --keep-daily 7 \ --keep-monthly 6 \ --keep-yearly 10 \ --keep-hourly 5 \ --keep-tag prs ''; r-prune = "sudo restic -r /mnt/storage/backups --password-file ~/srv/restic_pswd --cache- dir /srv/.restic-cache prune"; r-check = "sudo restic -r /mnt/storage/backups --cache-dir /srv/.restic-cache --password- file ~/srv/.restic_pswd check"; zconf = "nvim ~/.config/zsh/.zshrc"; zenv = "nvim ~/.config/zsh/.zshenv"; o = "xdg-open"; wget = "wget --hsts-file=${config.xdg.dataHome}/wget-hsts"; addagpl = "curl https://www.gnu.org/licenses/agpl-3.0.txt > COPYING"; addgpl = "curl https://www.gnu.org/licenses/gpl-3.0.txt > COPYING"; addapache = "curl https://www.apache.org/licenses/LICENSE-2.0.txt > LICENSE"; }; initExtraFirst = builtins.readFile ./config/instant-prompt.zsh + "source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme"; # + initExtra = '' export ZSH=${pkgs.oh-my-zsh}/share/oh-my-zsh/ export fpath=("$XDG_DATA_HOME/zsh/site-functions" $fpath) HISTFILE="$XDG_STATE_HOME/zsh/history" plugins=(git) source $ZSH/oh-my-zsh.sh '' + builtins.readFile ./config/p10k.zsh + builtins.readFile ./config/functions.zsh; }; }