{ pkgs, ... }:
{
  programs.bash.initExtra = ''
    # ssh autocomplete
    if test -f ~/.ssh/config; then
      complete -W "$(cat ~/.ssh/config | grep "^Host " | cut -d" " -f2- | grep -v '\*')" ssh
      complete -W "$(cat ~/.ssh/config | grep "^Host " | cut -d" " -f2- | grep -v '\*')" rssh
      complete -W "$(cat ~/.ssh/config | grep "^Host " | cut -d" " -f2- | grep -v '\*')" scp
      complete -W "$(cat ~/.ssh/config | grep "^Host " | cut -d" " -f2- | grep -v '\*')" remote-init
      complete -W "$(cat ~/.ssh/config | grep "^Host " | cut -d" " -f2- | grep -v '\*')" remote-add
    fi
  '';

  programs.ssh.enable = true;
  programs.ssh.controlMaster = "yes";
  programs.ssh.compression = true;
  programs.ssh.matchBlocks = {
    "*".serverAliveInterval = 10;
    "*".serverAliveCountMax = 3;
    "git.*".forwardX11 = false;
    "gitea.*".forwardX11 = false;
    "github.com".forwardX11 = false;
    "gogs.*".forwardX11 = false;
    "*.pbsds.net".forwardX11 = true;
    "*.pbsds.net".forwardX11Trusted = true;
    "*.tail9aac63.ts.net".forwardX11 = true;
    "*.tail9aac63.ts.net".forwardX11Trusted = true;
    "*.ntnu.no".user = "pederbs";
    "*.pvv.org".user = "pederbs";
    "*.pvv.org !login.pvv.org".proxyJump = "login.pvv.ntnu.no";
    "*.pvv.ntnu.no !login.pvv.ntnu.no".proxyJump = "login.pvv.ntnu.no";
    "*.hpc.ntnu.no".proxyJump = "login.pvv.ntnu.no";
    "*.idi.ntnu.no".proxyJump = "login.pvv.ntnu.no";

    # me
    "garp.pbsds.net".proxyJump = "login.pvv.ntnu.no";
    "eple.pbsds.net".proxyJump = "login.pvv.ntnu.no";
    "bolle.pbsds.net".proxyJump = "login.pvv.ntnu.no";
    "pederbs.idi.ntnu.no" = {};
    "brumlebasse.pbsds.net".port = 2222;
    "knut.pbsds.net".port = 23;
    "nord.pbsds.net".port = 24;
    "sopp.pbsds.net".port = 26;
    "noximilien.pbsds.net" = {};
    "rocm.pbsds.net".proxyJump = "login.pvv.ntnu.no";

    # nixos org
    #"aarch64.nixos.community" = {};
    # nix-community
    #"darwin-build-box.nix-community.org" = {};

    # ntnu
    "garmr.idi.ntnu.no".forwardX11 = true;
    "heid.idi.ntnu.no" = {}; #.forwardX11 = true;
    "idun.hpc.ntnu.no" = {};
    "login.stud.ntnu.no" = {};
    "malvik.idi.ntnu.no" = {};
    "oppdal.idi.ntnu.no" = {};
    "selbu.idi.ntnu.no" = {};
    "snotra.idi.ntnu.no" = {};
    "stud.ntnu.no".hostname = "login.stud.ntnu.no";
    /* "idun-login1.hpc.ntnu.no" = {}; */
    /* "idun-login2.hpc.ntnu.no" = {}; */
    /* "snotra-login1.idi.ntnu.no" = {}; */
    "clab01.idi.ntnu.no".proxyJump = "snotra-login1.idi.ntnu.no";
    "clab02.idi.ntnu.no".proxyJump = "snotra-login1.idi.ntnu.no";
    "clab03.idi.ntnu.no".proxyJump = "snotra-login1.idi.ntnu.no";
    "clab04.idi.ntnu.no".proxyJump = "snotra-login1.idi.ntnu.no";
    "clab05.idi.ntnu.no".proxyJump = "snotra-login1.idi.ntnu.no";
    "clab06.idi.ntnu.no".proxyJump = "snotra-login1.idi.ntnu.no";
    "clab07.idi.ntnu.no".proxyJump = "snotra-login1.idi.ntnu.no";
    "clab08.idi.ntnu.no".proxyJump = "snotra-login1.idi.ntnu.no";
    "clab09.idi.ntnu.no".proxyJump = "snotra-login1.idi.ntnu.no";
    "clab10.idi.ntnu.no".proxyJump = "snotra-login1.idi.ntnu.no";
    "clab11.idi.ntnu.no".proxyJump = "snotra-login1.idi.ntnu.no";
    "clab12.idi.ntnu.no".proxyJump = "snotra-login1.idi.ntnu.no";
    "clab13.idi.ntnu.no".proxyJump = "snotra-login1.idi.ntnu.no";
    "clab14.idi.ntnu.no".proxyJump = "snotra-login1.idi.ntnu.no";
    "clab15.idi.ntnu.no".proxyJump = "snotra-login1.idi.ntnu.no";
    "clab16.idi.ntnu.no".proxyJump = "snotra-login1.idi.ntnu.no";
    "clab17.idi.ntnu.no".proxyJump = "snotra-login1.idi.ntnu.no";
    "clab18.idi.ntnu.no".proxyJump = "snotra-login1.idi.ntnu.no";
    "clab19.idi.ntnu.no".proxyJump = "snotra-login1.idi.ntnu.no";
    "clab20.idi.ntnu.no".proxyJump = "snotra-login1.idi.ntnu.no";
    "clab21.idi.ntnu.no".proxyJump = "snotra-login1.idi.ntnu.no";
    "clab22.idi.ntnu.no".proxyJump = "snotra-login1.idi.ntnu.no";
    "clab23.idi.ntnu.no".proxyJump = "snotra-login1.idi.ntnu.no";
    "clab24.idi.ntnu.no".proxyJump = "snotra-login1.idi.ntnu.no";
    "clab25.idi.ntnu.no".proxyJump = "snotra-login1.idi.ntnu.no";
    "clab26.idi.ntnu.no".proxyJump = "snotra-login1.idi.ntnu.no";
    /* "clab27.idi.ntnu.no".proxyJump = "snotra-login1.idi.ntnu.no"; */
    /* "clab28.idi.ntnu.no".proxyJump = "snotra-login1.idi.ntnu.no"; */

    # NVG
    "nvg.ntnu.no".hostname = "login.stud.ntnu.no";
    "login.stud.ntnu.no" = {};

    # pvv
    "balduzius.pvv.ntnu.no".user = "root";
    "bekkalokk.pvv.ntnu.no" = {}; # pvv-web pvv-wiki pvv-webmail
    "bicep.pvv.ntnu.no" = {}; # pvv-databases pvv-synapse
    "brzeczyszczykiewicz.pvv.ntnu.no" = {};
    "demiurgen.pvv.ntnu.no" = {};
    "drolsum.pvv.ntnu.no" = {};
    "dvask-mgmt.pvv.ntnu.no".user = "root";
    "eirin.pvv.ntnu.no" = {};
    "georg.pvv.ntnu.no" = {};
    "git.pvv.ntnu.no" = {};
    "login.pvv.ntnu.no" = {};
    "orchid.pvv.ntnu.no" = {};
    "wegonke.pvv.ntnu.no" = {};
    "hildring.pvv.ntnu.no" = {};
    "innovation.pvv.ntnu.no".user = "root";
    "isvegg.pvv.ntnu.no" = {};
    "lommel.pvv.ntnu.no" = {};
    "microbel.pvv.ntnu.no" = {};
    "principal.pvv.ntnu.no".user = "root";
    "shark.pvv.ntnu.no" = {};
    "skrott.pvv.ntnu.no".user = "root";
    "sleipner.pvv.ntnu.no".user = "root";
    "tallulah.pvv.ntnu.no" = {};
    "tom.pvv.ntnu.no" = {};
    "toriel.pvv.ntnu.no".user = "root";
    /* "alphys.pvv.ntnu.no".user = "root"; */
    /* "dash8.pvv.ntnu.no" = {}; */
    /* "essendrop.pvv.ntnu.no" = {}; */
    /* "fenris.pvv.ntnu.no".user = "root"; */
    /* "hasub.pvv.ntnu.no" = {}; */
    /* "knakelibrak.pvv.ntnu.no" = {}; */
    /* "monty.pvv.ntnu.no" = {}; */
    /* "nsa.pvv.ntnu.no" = {}; */
    /* "skrotnisse.pvv.ntnu.no" = {}; */
    /* "spikkjeposche.pvv.ntnu.no" = {}; */
    /* "tim.pvv.ntnu.no" = {}; */

    # fyrkat
    #"fyrkat.no".hostname = "fridge.fyrkat.no";
    #"*.fyrkat.no".proxyJump = "login.pvv.ntnu.no";
    "fridge.fyrkat.no".port = 222;
    /* "fil.fyrkat.no" = {}; */
  };


}
