{ config, pkgs, ... }:
{
  programs = {
    bash = {
      enable = true;
      enableLsColors = true;
      completion = {
        enable = true;
        package = pkgs.bash-completion;
      };
      promptInit = ''
        PS1="(\h) [\u:\w] % "
      '';
      shellAliases = {
        "mount" = "doas mount --mkdir -v $@";
        "mkdir" = "mkdir -pv";
        "cp" = "cp -rv";
        "mv" = "mv -v $@";
        "rm" = "rm -v $@ -I";
        "ls" = "${pkgs.eza}/bin/eza --icons -l";
        "http" = "${pkgs.python3}/bin/python3 -m http.server 1337";
        "sudo" = "doas";
        "myip" = "curl -sSL icanhazip.com";
        "update" = "doas nixos-rebuild switch";
        "f" = "fastfetch";
      };
    };
    ssh = {
      askPassword = "${pkgs.openssh-askpass}/libexec/gtk-ssh-askpass";
    };
    git = {
      enable = true;
      config = {
        init = {
          defaultBranch = "main";
        };
        safe = {
          directory = "/etc/nixos";
        };
        user = {
          name = "halbg0tt";
          email = "halbg0tt@protonmail.com";
        };
        url = {
          "https://github.com" = {
            insteadOf = [
              "gh:"
              "github:"
            ];
          };
        };
      };
    };
    tmux = {
      enable = true;
      keyMode = "vi";
      aggressiveResize = true;
      terminal = "tmux-256color";
      extraConfig = ''
        unbind C-b
        # unbind t
        set -g prefix C-a
        bind C-a send-prefix

        bind r source-file /etc/tmux.conf

        setw -g mode-keys vi
        setw -g mouse on
        
        # make ctrl + arrow keys working
        set -s extended-keys on
        set -as terminal-features 'xterm*:extkeys'
        set -g xterm-keys on

        bind-key -n S-Left select-pane -L
        bind-key -n S-Down select-pane -D
        bind-key -n S-Up select-pane -U
        bind-key -n S-Right select-pane -R

        bind-key -n C-t new-window "#{pane_current_path}"
        bind t new-window

        bind-key -n M-w previous-window
        bind-key -n M-e next-window

        set -g base-index 1
        set -g renumber-windows on
        
        set-window-option -g clock-mode-colour colour196

        set -g status-bg black
        set -g status-fg white
        set -g status-position top
        set -g status-interval 1

        set -g status-left-length 64
        set -g status-left "#[bg=colour196,fg=black,bold] [#S] #[bg=black,fg=colour196,nobold,noitalics,nounderscore] "
        
        set -g status-right-length 64
        set -g status-right "#[bg=black,fg=black]#[bg=black,fg=white] #{pane_title} #[bg=black,fg=colour196,bold]#[bg=colour196,fg=black,bold] %a %d %b  #[fg=black,bold]%H:%M:%S "

        set-window-option -g window-status-current-format "#[bg=colour196,fg=black,nobold,noitalics,nounderscore]#[bg=colour196,fg=black,bold] #I #[bg=colour196,fg=black,bold] #W#{?window_zoomed_flag,*Z,} #[bg=black,fg=colour196,nobold,noitalics,nounderscore]"
        set-window-option -g window-status-format "#[bg=black,fg=black,noitalics]#[bg=black,fg=white] #I #[bg=black,fg=white] #W #[bg=black,fg=black,noitalics]"

        bind - split-window 
        bind \\ split-window -h 
      '';
    }; 
  };
}
