<commit_before>{ config, pkgs, lib, ... }:

{
  home.username = "perlinm";
  home.homeDirectory = "/home/perlinm";

  # This value determines the Home Manager release that your
  # configuration is compatible with. This helps avoid breakage
  # when a new Home Manager release introduces backwards
  # incompatible changes.
  #
  # You can update Home Manager without changing this value. See
  # the Home Manager release notes for a list of state version
  # changes in each release.
  home.stateVersion = "22.05";

  # Let Home Manager install and manage itself.
  programs.home-manager.enable = true;

  home.keyboard.options = [ "shift:both_capslock" "caps:backspace" ];
  home.keyboard.variant = "colemak";

  home.packages = with pkgs; [
    xfce.xfce4-terminal  # terminal emulator
    trashy  # trash management, replacing "rm"
    udevil  # sudo-free mounting
    htop  # process viewer
    ripgrep  # faster grep
    meld  # file comparison
    vistafonts  # adds consolas font

    # text editors
    helix
    vim
    emacs

    # programming languages
    gcc
    cargo
    python3
    texlive.combined.scheme-full

    # pdf viewers and editors
    qpdfview
    okular
    foxitreader
    pdftk

    vlc  # for watching videos
    # shutter  # screenshots
  ];

  fonts.fontconfig.enable = lib.mkForce true;

  home.sessionPath = [
    "/usr/bin"
    "/usr/local/bin"
    "/usr/local/sbin"
    "$HOME/.local/bin"
    "$HOME/.cargo/bin"
    "$HOME/.pyenv/bin"
    "$HOME/bin"
  ];

  home.sessionVariables = {
    EDITOR = "hx";
    VISUAL = "hx";
    BROWSER = "/usr/bin/firefox";
    TERM = "xterm-256color";

    NIX_ALLOW_UNFREE = 1;
    NIX_PATH = "$HOME/.nix-defexpr/channels:/nix/var/nix/profiles/per-user/root/channels$\{NIX_PATH:+:$NIX_PATH\}";

    RUST_BACKTRACE = 1;

    MATLAB_LOG_DIR = "/home/perlinm/Workspace/MATLAB/logs";
    QT_LOGGING_RULES = "qt5ct.debug=false";
    TF_CPP_MIN_LOG_LEVEL = 2;
  };

  home.shellAliases = {
    sudo = "sudo ";  # allows using aliases after "sudo"
    pm = "aptitude";  # package manager
    rem = "trash";  # trash management, replacing "rm"
    fire = "firefox";  # web browser

    # python aliases
    py = "python";
    ipy = "ipython";
    python = "python3";
    ipython = "ipython3";
    pyenv-init = ''
      eval "$(pyenv init --path)"
      eval "$(pyenv virtualenv-init -)"
    '';
    jupyter = "$(pyenv which jupyter)";
    pytest = "$(pyenv which pytest)";
    mypy = "$(pyenv which mypy)";
    flake8 = "$(pyenv which flake8)";

    # super.tech
    ss = ''
      pyenv-init
      cd ~/super.tech/SuperstaQ
    '';
    pygrep = "$HOME/super.tech/SuperstaQ/dev_tools/pygrep.sh";

    # telehealth
    tt = ''
      pyenv-init
      export FLASK_APP=app
      export FLASK_ENV=development
      cd ~/telehealth
      if [ "$(systemctl is-active postgresql.service)" != "active" ]; then
        echo "systemctl start postgresql.service"
        sudo systemctl start postgresql.service
      fi
    '';
  };
  
  ### package configurations

  programs.bash = {
    enable = true;
    enableCompletion = true;  # https://rycee.gitlab.io/home-manager/options.html#opt-programs.bash.enableCompletion
    enableVteIntegration = true;
  };

  programs.zsh = {
    enable = true;
    enableCompletion = true;  # https://rycee.gitlab.io/home-manager/options.html#opt-programs.zsh.enableCompletion
    enableVteIntegration = true;
    enableAutosuggestions = true;
    enableSyntaxHighlighting = true;
    defaultKeymap = "emacs";
    oh-my-zsh.enable = true;
    plugins = [
      # {
      #   name = "zsh-autocomplete";
      #   src = pkgs.fetchFromGitHub {
      #     owner = "marlonrichert";
      #     repo = "zsh-autocomplete";
      #     rev = "22.01.21";
      #     sha256 = "12y0zg06hqkkz5snzf1gp07fv8ds4fxar99bk6p9i0i3id6y4k7r";
      #   };
      # }
      # {
      #   name = "zsh-autosuggestions";
      #   src = pkgs.fetchFromGitHub {
      #     owner = "zsh-users";
      #     repo = "zsh-autosuggestions";
      #     rev = "v0.7.0";
      #     sha256 = "1g3pij5qn2j7v7jjac2a63lxd97mcsgw6xq6k5p7835q9fjiid98";
      #   };
      # }
    ];
    initExtra = ''
      # prompts
      PROMPT=$(print "[%{$fg[yellow]%}%*%{$reset_color%}]%{$fg[green]%}%~:\n$ %{$reset_color%}")
      SPROMPT='Correct '%R' to '%r' ? ([y]es/[N]o/[e]dit/[a]bort)'

      # fuzzy tab completion: https://superuser.com/a/815317
      zstyle ':completion:*' matcher-list "" \
        'm:{a-z\-}={A-Z\_}' \
        'r:[^[:alpha:]]||[[:alpha:]]=** r:|=* m:{a-z\-}={A-Z\_}' \
        'r:|?=** m:{a-z\-}={A-Z\_}'
    '';
    shellGlobalAliases = {
        "..." = "../..";
        "...." = "../../..";
        NN = "2>/dev/null";
    };
  };

  programs.exa.enable = true;
  programs.exa.enableAliases = true;

  programs.git = {
    enable = true;
    userName = "<NAME>";
    userEmail = "<EMAIL>";
    extraConfig = {
      core = { editor = "hx"; };
      init = { defaultBranch = "main"; };
      fetch = { prune = "true"; };
      pull = { ff = "only"; };
      push = { autoSetupRemote = "true"; };
    };
    aliases = {
      st = "status";
      br = "branch";
      co = "checkout";
    };
  };

  programs.helix.enable = true;
  xdg.configFile."helix/config.toml".source = ./helix/config.toml;<commit_msg>added xclip and some nit formatting changes<commit_after>{ config, pkgs, lib, ... }:

{
  home.username = "perlinm";
  home.homeDirectory = "/home/perlinm";

  # This value determines the Home Manager release that your
  # configuration is compatible with. This helps avoid breakage
  # when a new Home Manager release introduces backwards
  # incompatible changes.
  #
  # You can update Home Manager without changing this value. See
  # the Home Manager release notes for a list of state version
  # changes in each release.
  home.stateVersion = "22.05";

  # Let Home Manager install and manage itself.
  programs.home-manager.enable = true;

  home.keyboard.options = [ "shift:both_capslock" "caps:backspace" ];
  home.keyboard.variant = "colemak";

  nixpkgs.config.allowUnfree = true;
  home.packages = with pkgs; [
    xfce.xfce4-terminal  # terminal emulator
    trashy  # trash management, replacing "rm"
    udevil  # sudo-free mounting
    htop  # process viewer
    ripgrep  # faster grep
    meld  # file comparison
    xclip  # command-line clipboard
    vistafonts  # adds consolas font

    # text editors
    helix
    vim
    emacs

    # languages
    gcc
    cargo
    python3
    texlive.combined.scheme-full

    # pdf viewers and editors
    qpdfview
    okular
    foxitreader
    pdftk

    vlc  # for watching videos
    # shutter  # screenshots
  ];

  fonts.fontconfig.enable = lib.mkForce true;

  home.sessionPath = [
    "/usr/bin"
    "/usr/local/bin"
    "/usr/local/sbin"
    "$HOME/.local/bin"
    "$HOME/.cargo/bin"
    "$HOME/.pyenv/bin"
    "$HOME/bin"
  ];

  home.sessionVariables = {
    EDITOR = "hx";
    VISUAL = "hx";
    BROWSER = "/usr/bin/firefox";
    TERM = "xterm-256color";

    NIX_PATH = "$HOME/.nix-defexpr/channels:/nix/var/nix/profiles/per-user/root/channels$\{NIX_PATH:+:$NIX_PATH\}";
    RUST_BACKTRACE = 1;

    MATLAB_LOG_DIR = "/home/perlinm/Workspace/MATLAB/logs";
    QT_LOGGING_RULES = "qt5ct.debug=false";
    TF_CPP_MIN_LOG_LEVEL = 2;
  };

  home.shellAliases = {
    sudo = "sudo ";  # allows using aliases after "sudo"
    pm = "aptitude";  # package manager
    rem = "trash";  # trash management, replacing "rm"
    fire = "firefox";  # web browser

    # python aliases
    py = "python";
    ipy = "ipython";
    python = "python3";
    ipython = "ipython3";
    pyenv-init = ''
      eval "$(pyenv init --path)"
      eval "$(pyenv virtualenv-init -)"
    '';
    jupyter = "$(pyenv which jupyter)";
    pytest = "$(pyenv which pytest)";
    mypy = "$(pyenv which mypy)";
    flake8 = "$(pyenv which flake8)";

    # super.tech
    ss = ''
      pyenv-init
      cd ~/super.tech/SuperstaQ
    '';
    pygrep = "$HOME/super.tech/SuperstaQ/dev_tools/pygrep.sh";

    # telehealth
    tt = ''
      pyenv-init
      export FLASK_APP=app
      export FLASK_ENV=development
      cd ~/telehealth
      if [ "$(systemctl is-active postgresql.service)" != "active" ]; then
        echo "systemctl start postgresql.service"
        sudo systemctl start postgresql.service
      fi
    '';
  };
  
  ### package configurations

  programs.bash = {
    enable = true;
    enableCompletion = true;  # https://rycee.gitlab.io/home-manager/options.html#opt-programs.bash.enableCompletion
    enableVteIntegration = true;
  };

  programs.zsh = {
    enable = true;
    enableCompletion = true;  # https://rycee.gitlab.io/home-manager/options.html#opt-programs.zsh.enableCompletion
    enableVteIntegration = true;
    enableAutosuggestions = true;
    enableSyntaxHighlighting = true;
    defaultKeymap = "emacs";
    oh-my-zsh.enable = true;
    plugins = [
      # {
      #   name = "zsh-autocomplete";
      #   src = pkgs.fetchFromGitHub {
      #     owner = "marlonrichert";
      #     repo = "zsh-autocomplete";
      #     rev = "22.01.21";
      #     sha256 = "12y0zg06hqkkz5snzf1gp07fv8ds4fxar99bk6p9i0i3id6y4k7r";
      #   };
      # }
      # {
      #   name = "zsh-autosuggestions";
      #   src = pkgs.fetchFromGitHub {
      #     owner = "zsh-users";
      #     repo = "zsh-autosuggestions";
      #     rev = "v0.7.0";
      #     sha256 = "1g3pij5qn2j7v7jjac2a63lxd97mcsgw6xq6k5p7835q9fjiid98";
      #   };
      # }
    ];
    initExtra = ''
      # prompts
      PROMPT=$(print "[%{$fg[yellow]%}%*%{$reset_color%}]%{$fg[green]%}%~:\n$ %{$reset_color%}")
      SPROMPT='Correct '%R' to '%r' ? ([y]es/[N]o/[e]dit/[a]bort)'

      # fuzzy tab completion: https://superuser.com/a/815317
      zstyle ':completion:*' matcher-list "" \
        'm:{a-z\-}={A-Z\_}' \
        'r:[^[:alpha:]]||[[:alpha:]]=** r:|=* m:{a-z\-}={A-Z\_}' \
        'r:|?=** m:{a-z\-}={A-Z\_}'
    '';
    shellGlobalAliases = {
        "..." = "../..";
        "...." = "../../..";
        NN = "2>/dev/null";
    };
  };

  programs.exa.enable = true;
  programs.exa.enableAliases = true;

  programs.git = {
    enable = true;
    userName = "<NAME>";
    userEmail = "<EMAIL>";
    extraConfig = {
      core.editor = "hx";
      init.defaultBranch = "main";
      fetch.prune = "true";
      pull.ff = "only";
      push.autoSetupRemote = "true";
    };
    aliases = {
      st = "status";
      br = "branch";
      co = "checkout";
    };
  };

  programs.helix.enable = true;
  xdg.configFile."helix/config.toml".source = ./helix/config.toml;
{'fraction_non_alphanumeric': 0.15359199471349005, 'fraction_numerical': 0.015009912206173889, 'mean_word_length': 2.3546548448385054, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1816550', 'n_tokens_mistral': 4010, 'n_tokens_neox': 3805, 'n_words': 726}