aboutsummaryrefslogtreecommitdiff
path: root/minecraft.nix
diff options
context:
space:
mode:
Diffstat (limited to 'minecraft.nix')
-rw-r--r--minecraft.nix54
1 files changed, 0 insertions, 54 deletions
diff --git a/minecraft.nix b/minecraft.nix
deleted file mode 100644
index 0022ec6..0000000
--- a/minecraft.nix
+++ /dev/null
@@ -1,54 +0,0 @@
-{inputs, lib, pkgs, ...}: let
- allowMinecraft = pkg: builtins.elem (lib.getName pkg) [ "minecraft-server" ];
-
- unstable = import inputs.nixpkgs-unstable {
- inherit (pkgs.stdenv.hostPlatform) system;
- config.allowUnfreePredicate = allowMinecraft;
- };
-in {
- nixpkgs.config.allowUnfreePredicate = allowMinecraft;
-
- environment.systemPackages = [ pkgs.mcrcon ];
-
- networking.firewall.allowedTCPPorts = [ 25565 ];
- networking.firewall.allowedUDPPorts = [ 25565 ];
-
- services.minecraft-server = {
- enable = true;
- package = unstable.minecraft-server;
- eula = true;
- # openFirewall would also open rcon.port, so open the game port by hand
- openFirewall = false;
- declarative = true;
- whitelist = {
- mr_5aturn = "2b811fad-e419-401e-9185-70ab279219b5";
- CiderDonuts = "7a992778-71bc-4650-83a1-53069369481b";
- };
- serverProperties = {
- server-port = 25565;
- difficulty = "normal";
- gamemode = "survival";
- max-players = 5;
- white-list = true;
-
- enable-rcon = true;
- "rcon.port" = 25575;
- "rcon.password" = "mooshroom";
- };
- jvmOpts = "-Xms4096M -Xmx4096M";
- };
-
- systemd.services.minecraft-server = {
- startLimitBurst = 5;
- startLimitIntervalSec = 300;
- serviceConfig = {
- NoNewPrivileges = true;
-
- ProtectSystem = "full";
-
- MemoryMax = "6G";
- TasksMax = 512;
- RestartSec = "10s";
- };
- };
-}