diff --git a/nixos/hosts/asxpio-services/minecraft.nix b/nixos/hosts/asxpio-services/minecraft.nix index fb6b54f..2f0ad29 100644 --- a/nixos/hosts/asxpio-services/minecraft.nix +++ b/nixos/hosts/asxpio-services/minecraft.nix @@ -28,6 +28,16 @@ pkgs.stdenv.cc.cc.lib ]; }; + # AutoUpdateGeyser restarts the server with /restart; Paper finds no + # start script and exits 0, and systemd must start it again. The + # module binds the stdin socket to the service, so the exit stopped + # the socket and the socket's stop cancelled Restart=always. PartOf + # keeps the socket across an exit and still stops it with the service. + systemd.services.minecraft-server.serviceConfig.RestartSec = 10; + systemd.sockets.minecraft-server = { + bindsTo = lib.mkForce [ ]; + partOf = [ "minecraft-server.service" ]; + }; networking.firewall.allowedTCPPorts = [ 25565 ]; asxpio.security.ports = [ "tcp/25565/java"