{ pkgs, ... }:

{
  systemd.services.velocity = {
    description = "Minecraft Velocity Proxy";
    after = [
      "network-online.target"
    ];
    wants = [ "network-online.target" ];
    # requires = [ "limbo.service" ];
    wantedBy = [ "multi-user.target" ];

    serviceConfig = {
      Type = "simple";
      User = "imnyang";
      Group = "users";
      WorkingDirectory = "/home/imnyang/minecraft/proxy";
      ExecStart = "${pkgs.corretto25}/bin/java -jar /home/imnyang/minecraft/proxy/velocity.jar";
      Restart = "always";
      RestartSec = 5;
      SuccessExitStatus = [ 0 143 ];
    };
  };

  networking.firewall.allowedTCPPorts = [
    25565
  ];
}
