{ lib, pkgs, ... }:
{
  programs.zsh = {
    enable = true;

    history = {
      save = 100000;
      size = 100000;
    };

    initContent = (builtins.readFile ./zshrc);

    sessionVariables = let makePluginPath = format:
      (lib.strings.makeSearchPath format [
        "$HOME/.nix-profile/lib"
        "/run/current-system/sw/lib"
        "/etc/profiles/per-user/$USER/lib"
      ]) + ":$HOME/.${format}";
    in {
      _JAVA_AWT_WM_NONREPARENTING = 1; # fix stupid broken Java shit
      BROWSER = "firefox";
      CLAP_PATH = makePluginPath "clap";
      COLORFGBG = ";0";
      #COLORFGBG = "green;blue";
      #COLORTERM = "truecolor";
      DSSI_PATH = makePluginPath "dssi";
      EDITOR = "vim";
      IRCNAME = "Mark Nipper";
      IRCNICK = "nipsy";
      LADSPA_PATH = makePluginPath "ladspa";
      LC_COLLATE = "C";
      LV2_PATH = makePluginPath "lv2";
      LXVST_PATH = makePluginPath "lxvst";
      NNTPSERVER = "news.giganews.com";
      PAGER = "less";
      PASSWORD_STORE_ENABLE_EXTENSIONS = "true";
      PATH = "$HOME/bin:$PATH";
      #PS1 = "%B%n%b@%U%m%u/%l:%~> ";
      QUOTING_STYLE = "literal";
      VST_PATH = makePluginPath "vst";
      VST3_PATH = makePluginPath "vst3";
    };

    shellAliases = {
      FIXCAPS = "xdotool key Caps_Lock";
      fixkeyboard = "setxkbmap -layout us -option caps:super -option compose:ralt";
      ftp = "${pkgs.inetutils}/bin/ftp";
      geniso = "nix build ~/git/nix/nipsy#nixosConfigurations.iso.config.system.build.isoImage && ll result/iso/*iso";
      grep = "grep --color=auto";
      ip = "ip -c=auto";
      la = "ls -aF --color=auto";
      ll = "ls -alFhs --color=auto";
      lock = "xscreensaver-command -lock";
      nix-list-derivations = "nix-store --query --requisites /run/current-system | cut -d- -f2- | sort | uniq";
      nix-list-generations = "nixos-rebuild list-generations";
      steam-no-beta = "steam -clearbeta";
      telnet = "${pkgs.inetutils}/bin/telnet";
      zgrep = "zgrep --color=auto";
    };
  };
}
