diff --git a/applications/games/minecraft.nix b/applications/games/minecraft.nix index 37f65df..b4d9c2f 100644 --- a/applications/games/minecraft.nix +++ b/applications/games/minecraft.nix @@ -9,17 +9,24 @@ ]; }; - networking.firewall.allowedTCPPorts = [ 25565 ]; + networking.firewall.allowedTCPPorts = [ + # for the proxy + 25565 + + # the servers + 20000 + + 20001 + ]; # arion is one way to use docker on nixos + # see https://gitlab.com/c2842/computer_society/nixos/-/blob/733b867f4782afa795848135a83e97a5cafaf16a/applications/games/minecraft.nix + # for an example of a single compose file with multiple services virtualisation.arion = { backend = "docker"; projects = { - # this is basically one single docker-compose file - minecraft.settings = { - docker-compose.raw.networks.default.name = "minecraft"; - + minecraft_proxy.settings = { services = { mc_proxy = { service = { @@ -38,8 +45,12 @@ ]; }; }; + }; + }; - mc_compsoc = { + minecraft_compsoc_classic.settings = { + services = { + compsoc_classic = { service = { image = "nimmis/spigot:latest"; # setting these here as they arent special @@ -51,10 +62,19 @@ # where the config files are stored volumes = [ "/etc/games/minecraft/compsoc/test/config:/minecraft" ]; + + ports = [ + "20000:25565/tcp" + ]; }; }; - mc_compsoc2 = { + }; + }; + + minecraft_compsoc_test.settings = { + services = { + compsoc_test = { service = { image = "nimmis/spigot:latest"; environment = { @@ -65,6 +85,10 @@ # where the config files are stored volumes = [ "/etc/games/minecraft/compsoc/test2/config:/minecraft" ]; + + ports = [ + "20001:25565/tcp" + ]; }; };