games: split it up into 3 different services for easier management
This commit is contained in:
parent
733b867f47
commit
3eac87bbd8
1 changed files with 31 additions and 7 deletions
|
@ -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
|
# 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 = {
|
virtualisation.arion = {
|
||||||
backend = "docker";
|
backend = "docker";
|
||||||
projects = {
|
projects = {
|
||||||
|
|
||||||
# this is basically one single docker-compose file
|
minecraft_proxy.settings = {
|
||||||
minecraft.settings = {
|
|
||||||
docker-compose.raw.networks.default.name = "minecraft";
|
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
mc_proxy = {
|
mc_proxy = {
|
||||||
service = {
|
service = {
|
||||||
|
@ -38,8 +45,12 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
mc_compsoc = {
|
minecraft_compsoc_classic.settings = {
|
||||||
|
services = {
|
||||||
|
compsoc_classic = {
|
||||||
service = {
|
service = {
|
||||||
image = "nimmis/spigot:latest";
|
image = "nimmis/spigot:latest";
|
||||||
# setting these here as they arent special
|
# setting these here as they arent special
|
||||||
|
@ -51,10 +62,19 @@
|
||||||
|
|
||||||
# where the config files are stored
|
# where the config files are stored
|
||||||
volumes = [ "/etc/games/minecraft/compsoc/test/config:/minecraft" ];
|
volumes = [ "/etc/games/minecraft/compsoc/test/config:/minecraft" ];
|
||||||
|
|
||||||
|
ports = [
|
||||||
|
"20000:25565/tcp"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
mc_compsoc2 = {
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
minecraft_compsoc_test.settings = {
|
||||||
|
services = {
|
||||||
|
compsoc_test = {
|
||||||
service = {
|
service = {
|
||||||
image = "nimmis/spigot:latest";
|
image = "nimmis/spigot:latest";
|
||||||
environment = {
|
environment = {
|
||||||
|
@ -65,6 +85,10 @@
|
||||||
|
|
||||||
# where the config files are stored
|
# where the config files are stored
|
||||||
volumes = [ "/etc/games/minecraft/compsoc/test2/config:/minecraft" ];
|
volumes = [ "/etc/games/minecraft/compsoc/test2/config:/minecraft" ];
|
||||||
|
|
||||||
|
ports = [
|
||||||
|
"20001:25565/tcp"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue