minecraft: uses bedrock version for now

This commit is contained in:
Tigor Hutasuhut 2024-07-20 22:01:43 +07:00
parent a0ddbd5159
commit 564b3a8ef0

View file

@ -2,14 +2,21 @@
let let
name = "minecraft"; name = "minecraft";
podman = config.profile.podman; podman = config.profile.podman;
inherit (lib) mkIf; inherit (lib) mkIf strings;
ip = "10.88.200.1"; ip = "10.88.200.1";
image = "docker.io/05jchambers/legendary-minecraft-purpur-geyser:latest"; # image = "docker.io/05jchambers/legendary-minecraft-purpur-geyser:latest";
rootVolume = "/nas/podman/minecraft"; image = "docker.io/itzg/minecraft-bedrock-server:latest";
rootVolume = "/nas/podman/minecraft/hutasuhut";
domain = "${name}.tigor.web.id"; domain = "${name}.tigor.web.id";
user = config.profile.user; user = config.profile.user;
uid = toString user.uid; uid = toString user.uid;
gid = toString user.gid; gid = toString user.gid;
users = [
{
username = "CrowFX7414";
xuid = "2533274941938385";
}
];
in in
{ {
config = mkIf (podman.enable && podman.${name}.enable) { config = mkIf (podman.enable && podman.${name}.enable) {
@ -23,16 +30,12 @@ in
</head> </head>
<body> <body>
<h1>Congrats! The minecraft server should be up!</h1> <h1>Congrats! The minecraft server should be up!</h1>
<p> <h2>
For security reasons, connecting to the server requires Wireguard to be connected. This server is invitation only.
Ensure they are on first otherwise you won't be able to connect. Please contact the server owner for more info.
</p> </h2>
<p> <p>Server Address: <b>${domain}</b></p>
The server supports both Java and Bedrock Edition. Both shares the same world and can <p>Server Port: <b>19132</b></p>
play together. They only need to connect to different ports depending on the edition.
</p>
<p>Minecraft Java Server: <b>${domain}:25565</b></p>
<p>Minecraft Bedrock Server: <b>${domain}:19132</b></p>
</body> </body>
</html> </html>
EOF 200 EOF 200
@ -49,18 +52,28 @@ in
autoStart = true; autoStart = true;
user = "${uid}:${gid}"; user = "${uid}:${gid}";
environment = { environment = {
UID = uid;
GID = gid;
EULA = "TRUE";
TZ = "Asia/Jakarta"; TZ = "Asia/Jakarta";
SERVER_NAME = "Hutasuhut";
DEFAULT_PLAYER_PERMISSION_LEVEL = "operator";
LEVEL_NAME = "Hutasuhut";
MAX_THREADS = "0"; # Use as many as possible
ALLOW_LIST_USERS = strings.concatStringsSep "," (
map (user: "${user.username}:${user.xuid}") users
);
}; };
ports = [ ports = [
# Java Edition Ports # Java Edition Ports
"25565:25565/udp" # "25565:25565/udp"
"25565:25565" # "25565:25565"
# Bedrock Edition Ports # Bedrock Edition Ports
"19132:19132/udp" "19132:19132/udp"
"19132:19132" "19132:19132"
]; ];
volumes = [ volumes = [
"${rootVolume}:/minecraft" "${rootVolume}:/data"
]; ];
extraOptions = [ extraOptions = [
"--network=podman" "--network=podman"