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:
parent
6e1f77ccd9
commit
df996479dd
1 changed files with 43 additions and 2 deletions
|
@ -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 = { ... }:
|
||||
|
|
Loading…
Reference in a new issue