2023-04-25 23:24:54 +00:00
|
|
|
{
|
2023-04-27 00:47:17 +00:00
|
|
|
imports = [
|
|
|
|
../acme.nix
|
|
|
|
../nginx.nix
|
|
|
|
];
|
|
|
|
|
2023-04-25 23:24:54 +00:00
|
|
|
|
|
|
|
skynet_dns.records = {
|
|
|
|
external = [];
|
|
|
|
cname = [
|
|
|
|
# create a sub-subdomain for each game
|
|
|
|
"compsoc_classic.minecraft.games CNAME games"
|
2023-04-26 23:49:55 +00:00
|
|
|
"compsoc.minecraft.games CNAME games"
|
2023-04-27 00:47:17 +00:00
|
|
|
|
|
|
|
"map.compsoc_classic.minecraft.games CNAME games"
|
|
|
|
#"compsoc.minecraft.games CNAME games"
|
2023-04-25 23:24:54 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2023-04-26 00:52:47 +00:00
|
|
|
networking.firewall.allowedTCPPorts = [
|
|
|
|
# for the proxy
|
|
|
|
25565
|
|
|
|
|
|
|
|
# the servers
|
|
|
|
20000
|
|
|
|
|
|
|
|
20001
|
|
|
|
];
|
2023-04-25 23:24:54 +00:00
|
|
|
|
2023-04-27 00:47:17 +00:00
|
|
|
services.nginx.virtualHosts."compsoc_classic.minecraft.games.skynet.ie" = {
|
|
|
|
forceSSL = true;
|
|
|
|
useACMEHost = "skynet";
|
|
|
|
locations."/map/".alias = "/etc/games/minecraft/compsoc/classic/config/plugins/dynmap/web/";
|
|
|
|
};
|
|
|
|
|
2023-04-25 23:24:54 +00:00
|
|
|
# arion is one way to use docker on nixos
|
2023-04-26 00:52:47 +00:00
|
|
|
# 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
|
2023-04-25 23:24:54 +00:00
|
|
|
virtualisation.arion = {
|
|
|
|
backend = "docker";
|
|
|
|
projects = {
|
|
|
|
|
2023-04-26 01:01:29 +00:00
|
|
|
minecraft_proxy.settings.services.mc_proxy.service = {
|
2023-04-26 01:18:21 +00:00
|
|
|
image = "itzg/mc-router:1.18.0";
|
|
|
|
ports = [ "25565:25565/tcp" ];
|
|
|
|
expose = [ "25565" ];
|
|
|
|
command = [
|
2023-04-26 23:49:55 +00:00
|
|
|
"--mapping=compsoc_classic.minecraft.games.skynet.ie=172.17.0.1:20000,compsoc.minecraft.games.skynet.ie=172.17.0.1:20001"
|
2023-04-26 01:01:29 +00:00
|
|
|
];
|
|
|
|
};
|
2023-04-26 00:52:47 +00:00
|
|
|
|
2023-04-26 01:01:29 +00:00
|
|
|
minecraft_compsoc_classic.settings.services.compsoc_classic.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";
|
2023-04-25 23:24:54 +00:00
|
|
|
};
|
|
|
|
|
2023-04-26 01:01:29 +00:00
|
|
|
# where the config files are stored
|
2023-04-26 23:49:55 +00:00
|
|
|
volumes = [ "/etc/games/minecraft/compsoc/classic/config:/minecraft" ];
|
2023-04-25 23:24:54 +00:00
|
|
|
|
2023-04-26 01:01:29 +00:00
|
|
|
ports = [
|
|
|
|
"20000:25565/tcp"
|
|
|
|
];
|
|
|
|
};
|
2023-04-26 00:52:47 +00:00
|
|
|
|
2023-04-26 23:49:55 +00:00
|
|
|
minecraft_compsoc.settings.services.compsoc_test.service = {
|
2023-04-26 01:01:29 +00:00
|
|
|
image = "nimmis/spigot:latest";
|
|
|
|
environment = {
|
|
|
|
# this is what it last ran on
|
|
|
|
SPIGOT_VER="1.18.2";
|
|
|
|
EULA="true";
|
|
|
|
};
|
2023-04-25 23:24:54 +00:00
|
|
|
|
2023-04-26 01:01:29 +00:00
|
|
|
# where the config files are stored
|
2023-04-26 23:49:55 +00:00
|
|
|
volumes = [ "/etc/games/minecraft/compsoc/current/config:/minecraft" ];
|
2023-04-25 23:24:54 +00:00
|
|
|
|
2023-04-26 01:01:29 +00:00
|
|
|
ports = [
|
|
|
|
"20001:25565/tcp"
|
|
|
|
];
|
2023-04-25 23:24:54 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|