1
0
Fork 0
mirror of https://github.com/mdlayher/homelab.git synced 2024-12-14 11:47:32 +00:00

servnerr-3: start a Minecraft server container

Signed-off-by: Matt Layher <mdlayher@gmail.com>
This commit is contained in:
Matt Layher 2020-11-01 12:33:51 -05:00
parent 6e1f77ccd9
commit df996479dd
No known key found for this signature in database
GPG key ID: 77BFE531397EDE94

View file

@ -1,8 +1,50 @@
{ ... }:
{
# These services are proprietary and run containerized for confinement from
# the rest of the system and on unstable for faster update cycles.
containers = {
# Plex server running containerized and on unstable for faster updates.
minecraft = {
autoStart = true;
bindMounts = {
# Mount the data directory as read/write.
"/var/lib/minecraft" = {
hostPath = "/var/lib/minecraft";
isReadOnly = false;
};
};
config = { ... }:
let
secrets = import ./lib/secrets.nix;
unstable =
import <nixos-unstable-small> { config.allowUnfree = true; };
in {
services.minecraft-server = {
enable = true;
package = unstable.minecraft-server;
eula = true;
declarative = true;
# Use more RAM!
jvmOpts = "-Xmx16384M -Xms16384M";
serverProperties = {
motd = "Matt's Minecraft server";
enable-rcon = true;
"rcon.password" = secrets.minecraft.rcon;
pvp = false;
view-distance = 15;
};
whitelist = {
jacace = "c25f3433-06b2-4117-88b0-13aee986f7ee";
nerrster = "38f8c307-dde4-4774-a969-f4cc69dec50e";
};
};
};
};
plex = {
autoStart = true;
bindMounts = {
@ -24,7 +66,6 @@
};
};
# UniFi controller running containerized and on unstable for faster updates.
unifi = {
autoStart = true;
config = { ... }: