feat: minecraft server

This commit is contained in:
Ivan R. 2024-07-25 18:48:03 +05:00
parent b1c2a671d8
commit 2838be9f7b
No known key found for this signature in database
GPG key ID: 56C7BAAE859B302C
3 changed files with 31 additions and 0 deletions

View file

@ -30,6 +30,7 @@
./services/maddy.nix
./services/mastodon.nix
./services/microboard.nix
./services/minecraft.nix
./services/nextcloud.nix
./services/openssh.nix
./services/phoenix.nix

View file

@ -30,6 +30,8 @@
6881 # torrents
16001 # yggdrasil tcp
16002 # yggdrasil tls
25565 # minecraft
];
allowedUDPPorts = [
53 # DNS

View file

@ -0,0 +1,28 @@
{ config, ... }:
{
users.groups = {
minecraft = {};
};
users.users.minecraft = {
isNormalUser = true;
group = "minecraft";
};
virtualisation.oci-containers.containers.minecraft = {
autoStart = true;
image = "itzg/minecraft-server:stable";
ports = ["25565:25565"];
user = "1003:972";
environment = {
EULA = "TRUE";
TYPE = "PAPER";
VERSION = "1.21";
DIFFICULTY = "hard";
ONLINE_MODE = "false";
SERVER_NAME = "Comfycamp";
TZ = "Asia/Yekaterinburg";
};
volumes = [
"/var/lib/minecraft:/data"
];
};
}