{
  config,
  pkgs,
  lib,
  ...
}: {
  system.autoUpgrade = {
    enable = true;
    flake = "github:gradetools/minecraft-nix#grade-mc-server";
    dates = "minutely";
    flags = ["--option" "tarball-ttl" "0"];
  };
  services = {
    devmon.enable = true;
    dbus.enable = true;
    tailscale.enable = true;
    openssh = {
      enable = true;
      settings.PasswordAuthentication = false;
      settings.KbdInteractiveAuthentication = false;
    };
    fail2ban = {
      enable = true;
      maxretry = 5;
      bantime = "24h";
      bantime-increment = {
        enable = true;
        formula = "ban.Time * math.exp(float(ban.Count+1)*banFactor)/math.exp(1*banFactor)";
        maxtime = "168h";
        overalljails = true;
      };
      jails = {
        minecraft = ''
          port = 25565
          logpath = /var/log/minecraft-fail2ban.log
          maxretry = 5
          findtime = 600
          bantime = 3600
        '';
      };
    };
    avahi = {
      enable = true;
      nssmdns4 = true;
      openFirewall = true;
    };
    tlp = {
      enable = true;
      settings = {
        CPU_SCALING_GOVERNOR_ON_AC = "performance";
        CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
        CPU_MIN_PERF_ON_AC = 0;
        CPU_MAX_PERF_ON_AC = 100;
      };
    };
  };
  powerManagement = {
    cpuFreqGovernor = "performance";
  };
}
