mirror of
https://github.com/ordinary-dev/nixos-config.git
synced 2024-09-19 19:30:28 +05:00
feat: minecraft server
This commit is contained in:
parent
b1c2a671d8
commit
2838be9f7b
|
@ -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
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
6881 # torrents
|
||||
16001 # yggdrasil tcp
|
||||
16002 # yggdrasil tls
|
||||
|
||||
25565 # minecraft
|
||||
];
|
||||
allowedUDPPorts = [
|
||||
53 # DNS
|
||||
|
|
28
nixos/services/minecraft.nix
Normal file
28
nixos/services/minecraft.nix
Normal 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"
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue