aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/nixos/services/minecraft/tower/default.nix126
-rw-r--r--modules/nixos/services/minecraft/tower/towersmp-1.0.0.jarbin0 -> 4465 bytes
-rw-r--r--systems/x86_64-linux/copenhagen/default.nix5
3 files changed, 131 insertions, 0 deletions
diff --git a/modules/nixos/services/minecraft/tower/default.nix b/modules/nixos/services/minecraft/tower/default.nix
new file mode 100644
index 0000000..50243c1
--- /dev/null
+++ b/modules/nixos/services/minecraft/tower/default.nix
@@ -0,0 +1,126 @@
+{ options, config, lib, pkgs, namespace, ... }:
+
+with lib; with lib.${namespace}; let
+ cfg = config.${namespace}.services.minecraft.tower;
+ impermanence = config.${namespace}.system.impermanence;
+in {
+ options.${namespace}.services.minecraft.tower = with types; {
+ enable = mkEnableOption "tower smp minecraft server";
+
+ port = mkOption {
+ type = types.port;
+ default = 25565;
+ description = "server port";
+ };
+
+ start = mkOption {
+ type = types.bool;
+ default = true;
+ description = "autostart";
+ };
+
+ voicechat = {
+ port = mkOption {
+ type = types.port;
+ default = 24454;
+ description = "voice chat port";
+ };
+
+ force = mkOption {
+ type = types.bool;
+ default = false;
+ description = "require players to have simple voice chat installed";
+ };
+ };
+ };
+
+ config = mkIf cfg.enable {
+ cxl.services.minecraft.enable = true;
+
+ environment.persistence.${impermanence.location} = {
+ directories = [
+ "/srv/minecraft/tower"
+ ];
+ };
+
+ networking.firewall.allowedUDPPorts = [ cfg.voicechat.port ];
+
+ services.minecraft-servers.servers.tower = {
+ enable = true;
+ openFirewall = true;
+ autoStart = cfg.start;
+
+ package = pkgs.fabricServers.fabric-1_21_11;
+
+ operators = {
+ "trimet" = "5321640f-e00d-4118-a6cc-47094f19d084";
+ };
+
+ serverProperties = {
+ enforce-secure-profile = false;
+
+ white-list = true;
+ enforce-whitelist = true;
+
+ gamemode = "survival";
+ difficulty = "hard";
+ level-seed = "2048000367064948194";
+ spawn-protection = 0;
+
+ max-players = 69;
+ motd = "the \\u00a79tower\\u00a7r must grow";
+
+ server-port = cfg.port;
+ query-port = cfg.port;
+ };
+
+ symlinks = {
+ "mods" = pkgs.linkFarmFromDrvs "mods" (builtins.attrValues {
+ fabric = pkgs.fetchurl {
+ url = "https://cdn.modrinth.com/data/P7dR8mSH/versions/L34yYPTD/fabric-api-0.141.2%2B1.21.11.jar";
+ sha256 = "sha256-bB0MT90tgrVgcxiOTK0ogsgODtkifKNzRppCDRz2qXQ=";
+ };
+ noChatReports = pkgs.fetchurl {
+ url = "https://cdn.modrinth.com/data/qQyHxfxd/versions/rhykGstm/NoChatReports-FABRIC-1.21.11-v2.18.0.jar";
+ sha256 = "sha256-FIAjmJ8BT98BLlDYpDp1zErTkZn4mBT1yMo43N7+ELg=";
+ };
+ chunky = pkgs.fetchurl {
+ url = "https://cdn.modrinth.com/data/fALzjamp/versions/1CpEkmcD/Chunky-Fabric-1.4.55.jar";
+ sha256 = "sha256-M8vZvODjNmhRxLWYYQQzNOt8GJIkjx7xFAO77bR2vRU=";
+ };
+ spark = pkgs.fetchurl {
+ url = "https://cdn.modrinth.com/data/l6YH9Als/versions/1CB3cS0m/spark-1.10.156-fabric.jar";
+ sha256 = "sha256-Nu0Tj/3iovH8sy7LzH+iG+rxYR4APRnjrUCVSHPlcvo=";
+ };
+
+ #TODO: distributing this as a compiled binary... sucks
+ towersmp = pkgs.runCommandLocal "towersmp.jar" {} ''
+ cp ${./towersmp-1.0.0.jar} $out
+ '';
+ voicechat = pkgs.fetchurl {
+ url = "https://cdn.modrinth.com/data/9eGKb6K1/versions/1OVXKX2W/voicechat-fabric-1.21.11-2.6.11.jar";
+ sha256 = "sha256-G1/hX+4GVerQMnYrlaNdB8u+Df0hwl7gtSR6ydG5NTs=";
+ };
+
+ lithium = pkgs.fetchurl {
+ url = "https://cdn.modrinth.com/data/gvQqBUqZ/versions/gl30uZvp/lithium-fabric-0.21.2%2Bmc1.21.11.jar";
+ sha256 = "sha256-MQZjnHPuI/RL++Xl56gVTf460P1ISR5KhXZ1mO17Bzk=";
+ };
+ ferrite = pkgs.fetchurl {
+ url = "https://cdn.modrinth.com/data/uXXizFIs/versions/eRLwt73x/ferritecore-8.0.3-fabric.jar";
+ sha256 = "sha256-yG6rrNvwY5ibLKgSyOk/VWuP7/HJ38B8rvodkKXHvzU=";
+ };
+ krypton = pkgs.fetchurl {
+ url = "https://cdn.modrinth.com/data/fQEb0iXm/versions/O9LmWYR7/krypton-0.2.10.jar";
+ sha256 = "sha256-lCkdVpCgztf+fafzgP29y+A82sitQiegN4Zrp0Ve/4s=";
+ };
+ });
+
+ "config/voicechat/voicechat-server.properties" = pkgs.writeText "voicechat-server.properties" ''
+ port=${toString cfg.voicechat.port}
+ force_voice_chat=${boolToString cfg.voicechat.force}
+ '';
+ };
+ };
+ };
+}
diff --git a/modules/nixos/services/minecraft/tower/towersmp-1.0.0.jar b/modules/nixos/services/minecraft/tower/towersmp-1.0.0.jar
new file mode 100644
index 0000000..f4f2de4
--- /dev/null
+++ b/modules/nixos/services/minecraft/tower/towersmp-1.0.0.jar
Binary files differ
diff --git a/systems/x86_64-linux/copenhagen/default.nix b/systems/x86_64-linux/copenhagen/default.nix
index 20ecfa3..1c7b552 100644
--- a/systems/x86_64-linux/copenhagen/default.nix
+++ b/systems/x86_64-linux/copenhagen/default.nix
@@ -37,6 +37,11 @@ with lib; with lib.${namespace}; {
port = 25565;
};
+ tower = {
+ enable = true;
+ port = 25567;
+ };
+
stargazers = {
enable = true;
port = 25566;