From 2603cf95845f7cf9f21e13b08a52f1533c0275a6 Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Wed, 26 Apr 2023 00:09:31 +0100 Subject: [PATCH] games: turns out I wasnt treating it properly like a docker-compose file --- applications/games.nix | 116 +++++++++++++++++++---------------------- 1 file changed, 55 insertions(+), 61 deletions(-) diff --git a/applications/games.nix b/applications/games.nix index cbe6f8f..85cc8e2 100644 --- a/applications/games.nix +++ b/applications/games.nix @@ -14,8 +14,8 @@ external = []; cname = [ # create a sub-subdomain for each game - "mc_compsoc.games CNAME games" - "mc_compsoc2.games CNAME games" + "compsoc_classic.minecraft.games CNAME games" + "compsoc_test.minecraft.games CNAME games" ]; }; @@ -24,70 +24,64 @@ backend = "docker"; projects = { - mc_compsoc.settings = { - docker-compose.raw.networks.default.name = "mc_compsoc"; - - services.mc_compsoc = { - service.image = "nimmis/spigot:latest"; - # setting these here as they arent special - service.environment = { - # this is what it last ran on - SPIGOT_VER="1.18.2"; - EULA="true"; + # this is basically one single docker-compose file + minecraft.settings = { + docker-compose.raw.networks.default.name = "minecraft"; + + services = { + mc_proxy = { + service = { + image = "ghcr.io/haveachin/infrared:1.3.3"; + environment = { + INFRARED_CONFIG_PATH = "/configs"; + }; + + volumes = [ "/etc/games/minecraft/proxy:/configs" ]; + ports = [ + "25565:25565/tcp" + ]; + + expose = [ + "25565" + ]; + }; }; - - service.volumes = [ - # figure out what this needs and use itt o get up and running - # /home/nimmis/mc-srv:/minecraft - "/etc/games/minecraft/compsoc/test/config:/minecraft" - ]; - service.ports = [ - "25565:25565/tcp" - ]; + + mc_compsoc = { + service = { + image = "nimmis/spigot:latest"; + # setting these here as they arent special + environment = { + # this is what it last ran on + SPIGOT_VER="1.18.2"; + EULA="true"; + }; + + # where the config files are stored + volumes = [ "/etc/games/minecraft/compsoc/test/config:/minecraft" ]; + }; + }; + + mc_compsoc2 = { + service = { + image = "nimmis/spigot:latest"; + environment = { + # this is what it last ran on + SPIGOT_VER="1.18.2"; + EULA="true"; + }; + + # where the config files are stored + volumes = [ "/etc/games/minecraft/compsoc/test2/config:/minecraft" ]; + }; + + }; + }; }; - mc_compsoc2.settings = { - docker-compose.raw.networks.default.name = "mc_compsoc2"; + # next game here - services.mc_compsoc = { - service.image = "nimmis/spigot:latest"; - # setting these here as they arent special - service.environment = { - # this is what it last ran on - SPIGOT_VER="1.18.2"; - EULA="true"; - }; - - service.volumes = [ - # figure out what this needs and use itt o get up and running - # /home/nimmis/mc-srv:/minecraft - "/etc/games/minecraft/compsoc/test2/config:/minecraft" - ]; - service.ports = [ - "25566:25565/tcp" - ]; - }; - }; - - }; - }; - - services = { - nginx.virtualHosts = { - "mc_compsoc.games.skynet.ie" = { - forceSSL = true; - useACMEHost = "skynet"; - - locations."/".proxyPass = "http://localhost:25565"; - }; - - "mc_compsoc2.games.skynet.ie" = { - forceSSL = true; - useACMEHost = "skynet"; - - locations."/".proxyPass = "http://localhost:25566"; - }; }; }; } \ No newline at end of file