{
  pkgs,
  lib,
  config,
  ...
}: let
  program = "zsh";
  cfg = config.dots.${program};
  home_dir = config.home.homeDirectory;
  #sec = sops.secrets;
in {
  options.dots.${program} = {
    enable = lib.mkEnableOption "enables ${program}";
  };

  config = lib.mkIf cfg.enable {
    # export some defaults
    home.sessionVariables = {
      EDITOR = "nvim";
      PAGER = "less";
    };

    programs.${program} = {
      enable = true;
      dotDir = "${config.xdg.configHome}/zsh";
      #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_dir}/.config/zsh/.zshrc";
        src = "source ${home_dir}/.config/zsh/.zshrc";

        # --- config editing ---
        cfl = "nvim ${home_dir}/.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";
        gn = "cd ${home_dir}/.nix";

        # --- shortcuts ---
        vswap = "cd ${home_dir}/.local/state/nvim/swap";
        rswap = "rm ${home_dir}/.local/state/nvim/swap/*";
        v = "nvim";
        sv = "sudo nvim";
        vim = "nvim";
        mime-type = "xdg-mime query filetype";
        mime-default = "xdg-mime query default";

        # --- safety ---
        cp = "cp -iv";
        mv = "mv -iv";
        rm = "rm -Iv";

        # --- colors ---
        grep = "grep --color=auto";
        fgrep = "fgrep --color=auto";
        egrep = "egrep --color=auto";

        # --- scripts ---
        motd = "sh /etc/motd";
        rebuild = "sh ${home_dir}/.nix/bin/rebuild";
        perms = "sudo sh ${home_dir}/.nix/bin/fix-perms";

        # --- git ---
        status = "git status";
        add = "git add";
        commit = "git commit";
        push = "git push";
        pull = "git pull";
        dotfiles = "/usr/bin/git --git-dir=${home_dir}/.dotfiles --work-tree=$HOME";
        dtf = "/usr/bin/git --git-dir=${home_dir}/.dotfiles --work-tree=$HOME";
        sec = "sops ${home_dir}/.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";
        };
      };
    };
  };
}
