2023-12-29 23:44:37 +01:00
|
|
|
{ config, pkgs, lib, inputs, ... }:
|
2023-12-29 15:56:47 +01:00
|
|
|
{
|
2023-12-29 23:44:37 +01:00
|
|
|
imports = [ inputs.nix-minecraft.nixosModules.minecraft-servers ];
|
|
|
|
nixpkgs.overlays = [ inputs.nix-minecraft.overlay ];
|
|
|
|
|
|
|
|
services.minecraft-servers = {
|
2023-12-29 15:56:47 +01:00
|
|
|
enable = true;
|
|
|
|
eula = true;
|
|
|
|
openFirewall = true;
|
2023-12-29 23:44:37 +01:00
|
|
|
dataDir = "/var/lib/minecraft-wack";
|
|
|
|
|
|
|
|
servers.wack = {
|
|
|
|
enable = true;
|
|
|
|
jvmOpts = "-Xms4G -Xmx4G";
|
|
|
|
|
|
|
|
package = pkgs.fabricServers.fabric-1_20_4;
|
|
|
|
|
|
|
|
serverProperties = {
|
|
|
|
motd = "WackAttack M1n3cr4f7";
|
|
|
|
white-list = true;
|
|
|
|
difficulty = "normal";
|
|
|
|
view-distance = 16;
|
|
|
|
simulation-distance = 16;
|
|
|
|
enable-command-block = true;
|
|
|
|
enable-rcon = true;
|
|
|
|
"rcon.password" = "wack";
|
|
|
|
};
|
|
|
|
|
|
|
|
symlinks = {
|
|
|
|
mods = pkgs.linkFarmFromDrvs "mods" (builtins.attrValues {
|
|
|
|
FabricAPI = pkgs.fetchurl {
|
|
|
|
url = "https://cdn.modrinth.com/data/P7dR8mSH/versions/JMCwDuki/fabric-api-0.92.0%2B1.20.4.jar";
|
|
|
|
sha256 = "sha256-7U0BK5CBENWY4s3t+dXTASprIeY4Tdeyzc06lNGkc/Q=";
|
|
|
|
};
|
|
|
|
Lithium = pkgs.fetchurl {
|
|
|
|
url = "https://cdn.modrinth.com/data/gvQqBUqZ/versions/nMhjKWVE/lithium-fabric-mc1.20.4-0.12.1.jar";
|
|
|
|
sha256 = "sha256-as1JWV7mnhJkz8eYmPVpRS5BvWaYVGf8s40oBBka880=";
|
|
|
|
};
|
|
|
|
MCDiscordChat = pkgs.fetchurl {
|
|
|
|
url = "https://cdn.modrinth.com/data/D0sHdnXY/versions/tldGNWOW/MC-Discord-Chat-2.2.5.jar";
|
|
|
|
sha256 = "sha256-WK02gRNbTjbjQSIlWHP4aBSeGTZxtXwwbqt9fa7AJTA=";
|
|
|
|
};
|
2024-01-02 17:10:38 +01:00
|
|
|
SimpleVoiceChat = pkgs.fetchurl {
|
|
|
|
url = "https://cdn.modrinth.com/data/9eGKb6K1/versions/UIZXn9t1/voicechat-fabric-1.20.4-2.4.32.jar";
|
|
|
|
sha256 = "sha256-BZMK7Y8uaw1MvtQC1MXblsaaHy100a59KxSs4P0fjXE=";
|
|
|
|
};
|
2023-12-29 23:44:37 +01:00
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
whitelist = {
|
|
|
|
"_Oblivion" = "289be565-d73e-4cb1-a047-dcc319acdc80";
|
|
|
|
Crisju = "8b77dc43-27ba-4710-bbfd-4e01e6ec7461";
|
2024-01-02 17:10:38 +01:00
|
|
|
Dandellion = "f393413b-59fc-49d7-a5c4-83a5d177132c";
|
2024-01-25 10:15:24 +01:00
|
|
|
Evaraknes = "a6adfad8-6c3b-4a0d-912e-d84a0caa1caa";
|
2024-01-02 17:10:38 +01:00
|
|
|
Taschmex = "a3a258b0-901f-43d9-b130-dad3b29cd7ee";
|
|
|
|
guy_montag = "cb8aa890-a5a3-41f2-9bb7-1edb20c5a31f";
|
2023-12-29 23:44:37 +01:00
|
|
|
koppern = "3450494c-b945-4fa2-938c-5519adec005f";
|
2024-01-02 17:10:38 +01:00
|
|
|
krloer = "ab3029e2-76b6-4219-854e-16091fe5e421";
|
2024-01-09 13:45:41 +01:00
|
|
|
tictac1255 = "bab1f702-0e8b-4b98-8cce-bbfaed534d13";
|
2023-12-29 23:44:37 +01:00
|
|
|
};
|
|
|
|
};
|
2023-12-29 15:56:47 +01:00
|
|
|
};
|
2023-12-29 23:44:37 +01:00
|
|
|
|
|
|
|
# TODO: Automated backup job (https://git.pvv.ntnu.no/Drift/pvv-nixos-config/src/commit/57d1dfd121fdb23fcef54e0632f6f6278c6bb753/hosts/greddost/services/minecraft/default.nix#L144)
|
|
|
|
|
|
|
|
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
|
|
|
|
"minecraft-server"
|
|
|
|
];
|
2024-01-02 17:10:38 +01:00
|
|
|
|
|
|
|
networking.firewall.allowedUDPPorts = [ 24454 ];
|
2023-12-29 15:56:47 +01:00
|
|
|
}
|
|
|
|
|