From 893143dc2ed2239e2c9ec4e9342f417bbd5aea6e Mon Sep 17 00:00:00 2001 From: James Walker Date: Tue, 9 Aug 2022 21:35:47 -0400 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20add=20minecraft=20server?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #10 --- flake.lock | 18 +++++++++--------- hosts/plato/configuration.nix | 1 + modules/minecraft/default.nix | 23 +++++++++++++++++++++++ 3 files changed, 33 insertions(+), 9 deletions(-) create mode 100644 modules/minecraft/default.nix diff --git a/flake.lock b/flake.lock index 8247e74..75a6470 100644 --- a/flake.lock +++ b/flake.lock @@ -110,11 +110,11 @@ "utils": "utils_2" }, "locked": { - "lastModified": 1659878744, - "narHash": "sha256-81a9Mx5pDMBGN4WnVhcQVkW5mXNTZOt8DZOSI8bVKpU=", + "lastModified": 1659978484, + "narHash": "sha256-VkErPc8pXcuFQG7jkkaUOEMORe81oweRNlAYZJ2+aRI=", "owner": "nix-community", "repo": "home-manager", - "rev": "f5e9879e74e6202e2dbb3628fad2d20eac0d8be4", + "rev": "c1addfdad3825f75a66f8d73ec7d2f68c78ba6f8", "type": "github" }, "original": { @@ -125,11 +125,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1659356074, - "narHash": "sha256-UwV6hZZEtchvtiTCCD/ODEv1226eam8kEgEyQb7xB0E=", + "lastModified": 1660030916, + "narHash": "sha256-KeVTmST6vAS85uUaSYlzv6OWhveawfIGhqX1SMq+L30=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "ea3efc80f8ab83cb73aec39f4e76fe87afb15a08", + "rev": "3975d5158f00accda15a11180b2c08654cfb2807", "type": "github" }, "original": { @@ -189,11 +189,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1659868656, - "narHash": "sha256-LINDS957FYzOb412t/Zha44LQqGniMpUIUz4Pi+fvSs=", + "lastModified": 1660017629, + "narHash": "sha256-Koz6/k7c6hx4qVz/bboxdR2QsBdkxjRWpNmsOWJtXZE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "80fc83ad314fe701766ee66ac8286307d65b39e3", + "rev": "9f15d6c3a74d2778c6e1af67947c95f100dc6fd2", "type": "github" }, "original": { diff --git a/hosts/plato/configuration.nix b/hosts/plato/configuration.nix index 6c2be15..9eda78c 100644 --- a/hosts/plato/configuration.nix +++ b/hosts/plato/configuration.nix @@ -11,6 +11,7 @@ ../../modules/gitea ../../modules/home-assistant ../../modules/matrix + ../../modules/minecraft ../../modules/pleroma ../../modules/postgresql ../../modules/sops diff --git a/modules/minecraft/default.nix b/modules/minecraft/default.nix new file mode 100644 index 0000000..f2ff5f8 --- /dev/null +++ b/modules/minecraft/default.nix @@ -0,0 +1,23 @@ +{ pkgs, ... }: { + + services.minecraft-server = { + enable = true; + eula = true; + declarative = true; + + # see here for more info: https://minecraft.gamepedia.com/Server.properties#server.properties + serverProperties = { + server-port = 25565; + gamemode = "survival"; + motd = "Vanilla Survival"; + max-players = 20; + white-list = true; + }; + + # Grab UUIDs from https://mcuuid.net/ + whitelist = { + walkahj = "7209094c-b3ef-4c89-b8cd-0aef7c1d57a6"; + puffpuffpassion = "72e0d040-fa54-47e8-a6e7-162fdaa0cac5"; + }; + }; +}