diff --git a/applications/games.nix b/applications/games.nix index 85cc8e2..47601e3 100644 --- a/applications/games.nix +++ b/applications/games.nix @@ -1,87 +1,5 @@ { ... }: { - imports = []; - - /* - backups = [ - "/etc/silver_satisfactory/config/" - "/etc/silver_valheim/config/" - ]; - */ - - # since this is going to be pulled into a machiene that has skynet_dns we dont need to import it above - # gonna use it to create sub-subdomains for each game server - skynet_dns.records = { - external = []; - cname = [ - # create a sub-subdomain for each game - "compsoc_classic.minecraft.games CNAME games" - "compsoc_test.minecraft.games CNAME games" - ]; - }; - - # arion is one way to use docker on nixos - virtualisation.arion = { - backend = "docker"; - projects = { - - # 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" - ]; - }; - }; - - 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" ]; - }; - - }; - - }; - }; - - # next game here - - }; - }; + imports = [ + ./games/minecraft.nix + ]; } \ No newline at end of file diff --git a/applications/games/minecraft.nix b/applications/games/minecraft.nix new file mode 100644 index 0000000..37f65df --- /dev/null +++ b/applications/games/minecraft.nix @@ -0,0 +1,76 @@ +{ + + skynet_dns.records = { + external = []; + cname = [ + # create a sub-subdomain for each game + "compsoc_classic.minecraft.games CNAME games" + "compsoc_test.minecraft.games CNAME games" + ]; + }; + + networking.firewall.allowedTCPPorts = [ 25565 ]; + + # arion is one way to use docker on nixos + virtualisation.arion = { + backend = "docker"; + projects = { + + # 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" + ]; + }; + }; + + 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" ]; + }; + + }; + + }; + }; + }; + }; +} \ No newline at end of file diff --git a/machines/optimus.nix b/machines/optimus.nix index 50db3a9..b10be16 100644 --- a/machines/optimus.nix +++ b/machines/optimus.nix @@ -50,6 +50,4 @@ in { ]; }; - networking.firewall.allowedTCPPorts = [ 25565 ]; - }