From 497dfe1a6b6048c3b5085de10589d3e213fca59e Mon Sep 17 00:00:00 2001 From: Christine Elisabeth Koppel Date: Sun, 5 Apr 2026 23:24:48 +0300 Subject: [PATCH 1/7] Add AllTheMods10 modpack and configure additional server settings --- .../modules/system/minecraft.nix | 77 ++++++++++++++++++- nix-system-configs/modules/system/traefik.nix | 12 ++- 2 files changed, 83 insertions(+), 6 deletions(-) diff --git a/nix-system-configs/modules/system/minecraft.nix b/nix-system-configs/modules/system/minecraft.nix index 5d1128b..5a1c95d 100644 --- a/nix-system-configs/modules/system/minecraft.nix +++ b/nix-system-configs/modules/system/minecraft.nix @@ -7,6 +7,12 @@ choose = paths: builtins.head (builtins.filter (p: builtins.pathExists p) paths); # Domain and Cloudflare DDNS records configured here. Update this list to add/remove records. domain = "prg-radio.org"; + modpack = pkgs.fetchModrinthModpack { + # Get file from local system + src = /srv/minecraft/modpacks/AllTheMods10-prg.mrpack; + packHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; + side = "server"; + }; in { options.local = { hostname = lib.mkOption { @@ -48,8 +54,8 @@ in { services.tailscale.enable = true; - networking.firewall.allowedTCPPorts = [25565 24454 8100 19132]; - networking.firewall.allowedUDPPorts = [25565 24454 8100 19132]; + networking.firewall.allowedTCPPorts = [25565 25566 24454 8100 19132]; + networking.firewall.allowedUDPPorts = [25565 25566 24454 8100 19132]; # 24454 - https://modrepo.de/minecraft/voicechat/wiki/server_setup_self_hosted !!! # This is the VoiceChat mod in Minecraft @@ -66,6 +72,70 @@ in { eula = true; openFirewall = true; + servers.all-the-mods-ten = { + enable = true; + autoStart = true; + restart = "always"; + + package = pkgs.neoforgeServers.neoforge; + + jvmOpts = lib.concatStringsSep " " [ + "-Xms28G" + # Use 120GB of RA + "-Xmx32G" + + "-XX:+UseG1GC" + "-XX:+ParallelRefProcEnabled" + "-XX:MaxGCPauseMillis=80" + "-XX:+UnlockExperimentalVMOptions" + "-XX:+DisableExplicitGC" + "-XX:+AlwaysPreTouch" + "-XX:G1NewSizePercent=30" + "-XX:G1MaxNewSizePercent=50" + "-XX:G1HeapRegionSize=16M" + "-XX:G1ReservePercent=20" + "-XX:G1MixedGCCountTarget=4" + "-XX:InitiatingHeapOccupancyPercent=15" + "-XX:G1MixedGCLiveThresholdPercent=90" + "-XX:G1RSetUpdatingPauseTimePercent=5" + ]; + + serverProperties = { + server-port = 25566; + motd = "PRG Fabric Modded Server"; + difficulty = "hard"; + gamemode = "survival"; + max-players = 64; + online-mode = true; + white-list = false; + spawn-protection = 0; + view-distance = 9; + simulation-distance = 3; + enforce-secure-profile = false; + enable-command-block = false; + enable-rcon = false; + require-resource-pack = false; + level-seed = "-2032795982907864146"; + }; + + # Grant operator privileges to the user with the given UUID. + # Update `name` to the player's Minecraft username if you know it. + operators = { + username1 = { + uuid = "5e52c4ba-9b1a-469b-8f68-b9d684eae31d"; + level = 4; # 4 = highest permission (operator) + bypassesPlayerLimit = true; + }; + }; + + symlinks = { + "mods" = "${modpack}/mods"; + }; + files = { + "config" = "${modpack}/config"; + }; + }; + servers.fabric-modded = { enable = true; autoStart = true; @@ -106,7 +176,7 @@ in { white-list = false; spawn-protection = 0; view-distance = 9; - simulation-distance = 4; + simulation-distance = 3; enforce-secure-profile = false; enable-command-block = false; enable-rcon = false; @@ -286,7 +356,6 @@ in { sha512 = "a9f673fac1f6f554b7394168cbe726f1a15eb2bbef1b65b3c9979853af8de70bf13a457c88ebdc30b955a071d519e86c631cdbf1dd39cdab7c73b9c2d7f165e1"; }; - AddCollective = pkgs.fetchurl { url = "https://cdn.modrinth.com/data/e0M1UDsY/versions/T8rv7kwo/collective-1.21.11-8.13.jar"; sha512 = "af145a48ac89346c7b1ffa8c44400a91a9908e4d1df0f6f1a603ff045b1fd82d9aa041aea27a682c196b266c0daf84cb5b7b8d83b07ee53e2bc1a5c210d19a1b"; diff --git a/nix-system-configs/modules/system/traefik.nix b/nix-system-configs/modules/system/traefik.nix index 39de6dc..9c7b9f4 100644 --- a/nix-system-configs/modules/system/traefik.nix +++ b/nix-system-configs/modules/system/traefik.nix @@ -305,6 +305,9 @@ in { minecraft = { address = "[::]:25565"; }; + minecraft_modded = { + address = "[::]:25566"; + }; # Minecraft Bedrock (default port 19132) - expose both TCP and UDP minecraft-bedrock-tcp = {address = "[::]:19132";}; @@ -663,6 +666,11 @@ in { {address = "10.1.1.244:25565";} ]; }; + minecraft_modded.loadBalancer = { + servers = [ + {address = "10.1.1.244:25566";} + ]; + }; # TCP service for Minecraft Bedrock minecraft-bedrock-tcp.loadBalancer = { @@ -1041,8 +1049,8 @@ in { }; # Allow common HTTP/S and control ports, - networking.firewall.allowedTCPPorts = [80 443 10022 30033 8448 9001 3001 993 465 25 25565 24454 2456 2457 2458 26000 1234 3979 2022 19132]; - networking.firewall.allowedUDPPorts = [80 443 9987 9001 3001 993 465 25 25565 24454 2022 2456 2457 2458 26000 1234 3979 2022 19132]; + networking.firewall.allowedTCPPorts = [80 443 10022 30033 8448 9001 3001 993 465 25 25565 25566 24454 2456 2457 2458 26000 1234 3979 2022 19132]; + networking.firewall.allowedUDPPorts = [80 443 9987 9001 3001 993 465 25 25565 25566 24454 2022 2456 2457 2458 26000 1234 3979 2022 19132]; system.stateVersion = "25.11"; }; From 397bb2d6cefc6bffd7c299b2259ad3384d46336d Mon Sep 17 00:00:00 2001 From: Christine Elisabeth Koppel Date: Sun, 5 Apr 2026 23:47:30 +0300 Subject: [PATCH 2/7] Refactor NixOS Minecraft configuration to use overlays for improved module management --- flake.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 475350a..8eb7a94 100644 --- a/flake.nix +++ b/flake.nix @@ -70,12 +70,14 @@ modules = [./nix-system-configs/modules/system/mail-server.nix]; }; - "nixos-minecraft" = nixpkgs.lib.nixosSystem { + "nixos-minecraft" = (import inputs.nixpkgs { + inherit system; + overlays = [ inputs.nix-minecraft.overlay ]; + }).lib.nixosSystem { inherit system; modules = [ ./nix-system-configs/modules/system/minecraft.nix nix-minecraft.nixosModules.minecraft-servers - {nixpkgs.overlays = [inputs.nix-minecraft.overlay];} ]; }; }; From a9a857b460feec1ca3bc505a4540491693e454de Mon Sep 17 00:00:00 2001 From: Christine Elisabeth Koppel Date: Sun, 5 Apr 2026 23:53:05 +0300 Subject: [PATCH 3/7] Revert "Refactor NixOS Minecraft configuration to use overlays for improved module management" This reverts commit 397bb2d6cefc6bffd7c299b2259ad3384d46336d. --- flake.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index 8eb7a94..475350a 100644 --- a/flake.nix +++ b/flake.nix @@ -70,14 +70,12 @@ modules = [./nix-system-configs/modules/system/mail-server.nix]; }; - "nixos-minecraft" = (import inputs.nixpkgs { - inherit system; - overlays = [ inputs.nix-minecraft.overlay ]; - }).lib.nixosSystem { + "nixos-minecraft" = nixpkgs.lib.nixosSystem { inherit system; modules = [ ./nix-system-configs/modules/system/minecraft.nix nix-minecraft.nixosModules.minecraft-servers + {nixpkgs.overlays = [inputs.nix-minecraft.overlay];} ]; }; }; From a86437d4b2c0d43e5a9879c61aaa3bc6b49d4b3b Mon Sep 17 00:00:00 2001 From: Christine Elisabeth Koppel Date: Mon, 6 Apr 2026 00:08:14 +0300 Subject: [PATCH 4/7] Add initial configuration files and validation scripts for NixOS setup --- flake.nix | 8 ++++++-- nix-system-configs/modules/system/minecraft.nix | 16 ++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/flake.nix b/flake.nix index 475350a..a7d1c5d 100644 --- a/flake.nix +++ b/flake.nix @@ -73,9 +73,13 @@ "nixos-minecraft" = nixpkgs.lib.nixosSystem { inherit system; modules = [ - ./nix-system-configs/modules/system/minecraft.nix + # Apply the overlay first so pkgs in later modules (like our local + # `minecraft.nix`) see the extra helpers provided by the overlay + { nixpkgs.overlays = [ inputs.nix-minecraft.overlay ]; } + nix-minecraft.nixosModules.minecraft-servers - {nixpkgs.overlays = [inputs.nix-minecraft.overlay];} + + ./nix-system-configs/modules/system/minecraft.nix ]; }; }; diff --git a/nix-system-configs/modules/system/minecraft.nix b/nix-system-configs/modules/system/minecraft.nix index 5a1c95d..55bc469 100644 --- a/nix-system-configs/modules/system/minecraft.nix +++ b/nix-system-configs/modules/system/minecraft.nix @@ -7,12 +7,10 @@ choose = paths: builtins.head (builtins.filter (p: builtins.pathExists p) paths); # Domain and Cloudflare DDNS records configured here. Update this list to add/remove records. domain = "prg-radio.org"; - modpack = pkgs.fetchModrinthModpack { - # Get file from local system - src = /srv/minecraft/modpacks/AllTheMods10-prg.mrpack; - packHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; - side = "server"; - }; + # Try to use the nix-minecraft helper if the overlay is present; otherwise + # fall back to a local path. If you use the fallback, ensure the path is an + # unpacked modpack directory with `mods` and `config` subdirectories. + modpack = /srv/minecraft/modpacks/AllTheMods10-prg.mrpack; in { options.local = { hostname = lib.mkOption { @@ -129,10 +127,12 @@ in { }; symlinks = { - "mods" = "${modpack}/mods"; + "mods" = "${modpack}/overrides/mods"; }; files = { - "config" = "${modpack}/config"; + "config" = "${modpack}/overrides/config"; + "kubejs" = "${modpack}/overrides/kubejs"; + "datapacks" = "${modpack}/overrides/datapacks"; }; }; From 41f11ae351bda66634ff3b269972152891765cab Mon Sep 17 00:00:00 2001 From: Christine Elisabeth Koppel Date: Mon, 6 Apr 2026 00:10:28 +0300 Subject: [PATCH 5/7] Update server MOTD for All the Mods 10 configuration --- nix-system-configs/modules/system/minecraft.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix-system-configs/modules/system/minecraft.nix b/nix-system-configs/modules/system/minecraft.nix index 55bc469..7e945e7 100644 --- a/nix-system-configs/modules/system/minecraft.nix +++ b/nix-system-configs/modules/system/minecraft.nix @@ -100,7 +100,7 @@ in { serverProperties = { server-port = 25566; - motd = "PRG Fabric Modded Server"; + motd = "The Sub Server All the Mods 10"; difficulty = "hard"; gamemode = "survival"; max-players = 64; From 7364904eb3ed41bda616c63c3da3e4dda393e5d4 Mon Sep 17 00:00:00 2001 From: Christine Elisabeth Koppel Date: Mon, 6 Apr 2026 00:33:34 +0300 Subject: [PATCH 6/7] Update Minecraft server package version and simplify JVM options --- nix-system-configs/modules/system/minecraft.nix | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/nix-system-configs/modules/system/minecraft.nix b/nix-system-configs/modules/system/minecraft.nix index 7e945e7..f6cbd9c 100644 --- a/nix-system-configs/modules/system/minecraft.nix +++ b/nix-system-configs/modules/system/minecraft.nix @@ -75,27 +75,12 @@ in { autoStart = true; restart = "always"; - package = pkgs.neoforgeServers.neoforge; + package = pkgs.neoforgeServers.neoforge-1_21_1-21_1_224; jvmOpts = lib.concatStringsSep " " [ "-Xms28G" # Use 120GB of RA "-Xmx32G" - - "-XX:+UseG1GC" - "-XX:+ParallelRefProcEnabled" - "-XX:MaxGCPauseMillis=80" - "-XX:+UnlockExperimentalVMOptions" - "-XX:+DisableExplicitGC" - "-XX:+AlwaysPreTouch" - "-XX:G1NewSizePercent=30" - "-XX:G1MaxNewSizePercent=50" - "-XX:G1HeapRegionSize=16M" - "-XX:G1ReservePercent=20" - "-XX:G1MixedGCCountTarget=4" - "-XX:InitiatingHeapOccupancyPercent=15" - "-XX:G1MixedGCLiveThresholdPercent=90" - "-XX:G1RSetUpdatingPauseTimePercent=5" ]; serverProperties = { From 933f6f9760b36758a2d9b83726a40d68b0caac83 Mon Sep 17 00:00:00 2001 From: Christine Elisabeth Koppel Date: Mon, 6 Apr 2026 00:33:34 +0300 Subject: [PATCH 7/7] Derp --- nix-system-configs/modules/system/minecraft.nix | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/nix-system-configs/modules/system/minecraft.nix b/nix-system-configs/modules/system/minecraft.nix index 7e945e7..16f7359 100644 --- a/nix-system-configs/modules/system/minecraft.nix +++ b/nix-system-configs/modules/system/minecraft.nix @@ -75,27 +75,12 @@ in { autoStart = true; restart = "always"; - package = pkgs.neoforgeServers.neoforge; + package = pkgs.neoforgeServers.neoforge-1_21_1-21_1_220; jvmOpts = lib.concatStringsSep " " [ "-Xms28G" # Use 120GB of RA "-Xmx32G" - - "-XX:+UseG1GC" - "-XX:+ParallelRefProcEnabled" - "-XX:MaxGCPauseMillis=80" - "-XX:+UnlockExperimentalVMOptions" - "-XX:+DisableExplicitGC" - "-XX:+AlwaysPreTouch" - "-XX:G1NewSizePercent=30" - "-XX:G1MaxNewSizePercent=50" - "-XX:G1HeapRegionSize=16M" - "-XX:G1ReservePercent=20" - "-XX:G1MixedGCCountTarget=4" - "-XX:InitiatingHeapOccupancyPercent=15" - "-XX:G1MixedGCLiveThresholdPercent=90" - "-XX:G1RSetUpdatingPauseTimePercent=5" ]; serverProperties = {