From ff604fa02d70a733e254dc1571b49f657ca46cd7 Mon Sep 17 00:00:00 2001 From: Clayton Hickey Date: Sat, 7 Mar 2026 18:26:19 -0500 Subject: [PATCH] cobblemon public --- loadedskypotato/configuration.nix | 15 --------------- minecraft/minecraft-servers.nix | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/loadedskypotato/configuration.nix b/loadedskypotato/configuration.nix index 82b97a1..99c7f75 100644 --- a/loadedskypotato/configuration.nix +++ b/loadedskypotato/configuration.nix @@ -123,17 +123,6 @@ in }; }; - services.nginx.streamConfig = '' - server { - listen 25565 reuseport; - proxy_pass 10.100.0.2:25565; - } - server { - listen 25566 reuseport; - proxy_pass 10.100.0.2:25566; - } - ''; - services.dnsmasq = { enable = true; settings = { @@ -158,10 +147,6 @@ in usePredictableInterfaceNames = false; useDHCP = false; firewall = { - allowedTCPPorts = [ - 25565 # minecraft survival - 25566 # minecraft creative - ]; allowedUDPPorts = [ 51820 # wireguard ]; diff --git a/minecraft/minecraft-servers.nix b/minecraft/minecraft-servers.nix index a3eb097..f55e538 100644 --- a/minecraft/minecraft-servers.nix +++ b/minecraft/minecraft-servers.nix @@ -108,5 +108,28 @@ in cobblemonPort ]; }) + + (lib.mkIf (config.networking.hostName == "loadedskypotato") { + services.nginx.streamConfig = '' + server { + listen ${survivalPort} reuseport; + proxy_pass 10.100.0.2:${survivalPort}; + } + server { + listen ${creativePort} reuseport; + proxy_pass 10.100.0.2:${creativePort}; + } + server { + listen ${cobblemonPort} reuseport; + proxy_pass 10.100.0.2:${cobblemonPort}; + } + ''; + + networking.firewall.allowedTCPPorts = [ + survivalPort + creativePort + cobblemonPort + ]; + }) ]; }