games: split minecraft out into its own folder for manageability

This commit is contained in:
silver 2023-04-26 00:24:54 +01:00
parent 2603cf9584
commit 733b867f47
3 changed files with 79 additions and 87 deletions

View file

@ -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
];
}

View file

@ -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" ];
};
};
};
};
};
};
}

View file

@ -50,6 +50,4 @@ in {
];
};
networking.firewall.allowedTCPPorts = [ 25565 ];
}