diff options
| author | Alexander Kassouni <alex@kassouni.net> | 2026-09-27 22:07:56 -0700 |
|---|---|---|
| committer | Alexander Kassouni <alex@kassouni.net> | 2026-09-27 22:08:31 -0700 |
| commit | e037e164c5c45ff33525d0c8575e8d9e0315ac7b (patch) | |
| tree | d350808fdb003a196b5c31b6bd2ad5c77345e0aa /minecraft.nix | |
| parent | 4072628986ccb63a8107e58a6aa35dc6056ded4b (diff) | |
move nix modules
Diffstat (limited to 'minecraft.nix')
| -rw-r--r-- | minecraft.nix | 54 |
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"; - }; - }; -} |