minecraft: use docker image for forge 1.19.2 server

nix-minecraft does not support forge and its hard to try and get forge
to install
This commit is contained in:
Nico 2025-05-10 18:00:34 +10:00
parent 51db11d4bf
commit 093c102a6b
3 changed files with 33 additions and 33 deletions

View file

@ -0,0 +1,32 @@
{ config, pkgs, ... }:
{
virtualisation.oci-containers.containers.forge-1-19-2 = {
user = "minecraft:minecraft";
image = "docker.io/itzg/minecraft-server";
volumes = [ "/var/lib/minecraft/forge-1-19-2/:/data" ];
ports = [ "30004:30004" ];
environment = {
TYPE = "FORGE";
VERSION = "1.19.2";
EULA = "TRUE";
MEMORY = "4G";
SERVER_PORT = "30004";
UID = "992";
GID = "991";
};
};
services.minecraft-servers.servers.velocity.symlinks."velocity.toml".value = {
servers = {
forge-1-19-2 = "127.0.0.1:30004";
# In what order we should try servers when a player logs in or is kicked from a server.
try = [
"forge-1-19-2"
];
};
};
}