introduce lib.rad-dev.mapAttrsToString, fix mc-router

Signed-off-by: ahuston-0 <aliceghuston@gmail.com>
This commit is contained in:
2024-08-16 08:59:15 -04:00
parent 3eb1b759fe
commit 680b2b036d
2 changed files with 23 additions and 5 deletions

View File

@ -21,7 +21,7 @@ let
USE_AIKAR_FLAGS = "true";
MEMORY = "8GB";
ALLOW_FLIGHT = "true";
MAX_TICK_TIME = -1;
MAX_TICK_TIME = "-1";
};
defaultOptions = [
@ -32,7 +32,7 @@ let
];
in
{
virtualisation.oci-containers = {
virtualisation.oci-containers.containers = {
mc-router = {
image = "itzg/mc-router:latest";
extraOptions = [
@ -40,9 +40,12 @@ in
"--network=haproxy-net"
"--network=minecraft-net"
];
command =
"--mapping=mc.alicehuston.xyz=${defaultServer}:25565"
+ (lib.mapAttrs (hostname: url: ",${url}=${hostname}:25565") servers);
cmd = [
(
"--mapping=mc.alicehuston.xyz=${defaultServer}:25565"
+ (lib.rad-dev.mapAttrsToString (hostname: url: "," + url + "=" + hostname + ":25565") servers)
)
];
};
rlcraft = {
image = "itzg/minecraft-server:java8";