Skip to content

Commit

Permalink
hosts/alpha: add minecraft server
Browse files Browse the repository at this point in the history
  • Loading branch information
fufexan committed Apr 21, 2024
1 parent 4453b8f commit caf7674
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions hosts/alpha/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
imports = [
./hardware.nix
./impermanence.nix
./minecraft.nix
];

networking.hostName = "alpha";
Expand Down
17 changes: 17 additions & 0 deletions hosts/alpha/minecraft.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{pkgs, ...}: {
services.minecraft-server = {
enable = true;
package = pkgs.minecraftServers.vanilla-1-20;
eula = true;
jvmOpts = "-Xms4092M -Xmx4092M
-XX:+UseG1GC -XX:+CMSIncrementalPacing
-XX:+CMSClassUnloadingEnabled -XX:ParallelGCThreads=2
-XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10";
openFirewall = true;
};

networking.firewall = {
allowedTCPPorts = [25575];
allowedUDPPorts = [25575];
};
}

0 comments on commit caf7674

Please sign in to comment.