mirror of
https://codeberg.org/polyteknisk-radiogruppe/the_prg_server_configuration.git
synced 2026-06-13 18:28:55 +02:00
162 lines
6.6 KiB
Nix
162 lines
6.6 KiB
Nix
{
|
|
config,
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}: let
|
|
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";
|
|
in {
|
|
options.local = {
|
|
hostname = lib.mkOption {
|
|
type = lib.types.str;
|
|
default = "nixos-default";
|
|
description = "System hostname";
|
|
};
|
|
username = lib.mkOption {
|
|
type = lib.types.str;
|
|
default = "user";
|
|
description = "Primary user username";
|
|
};
|
|
userDescription = lib.mkOption {
|
|
type = lib.types.str;
|
|
default = "NixOS User";
|
|
description = "Primary user description";
|
|
};
|
|
address = lib.mkOption {
|
|
type = lib.types.str;
|
|
default = "10.1.1.100";
|
|
description = "Static IP address";
|
|
};
|
|
};
|
|
|
|
imports = [
|
|
(choose [./modules/desktop-manager/sway_greetd_homemanager.nix ../desktop-manager/sway_greetd_homemanager.nix])
|
|
(choose [./modules/local/hostname_username.nix ../local/hostname_username.nix])
|
|
(choose [./modules/local/networking_local.nix ../local/networking_local.nix])
|
|
(choose [./modules/bootloader/seabios-assigned-iso-at-birth.nix ../bootloader/seabios-assigned-iso-at-birth.nix])
|
|
(choose [./modules/lix-default.nix ../lix-default.nix])
|
|
# Optionally: (choose [ ./modules/toolsets/remote_building.nix ../toolsets/remote_building.nix ])
|
|
];
|
|
|
|
config = {
|
|
local.hostname = "nixos-minecraft";
|
|
local.username = "minecraftprg";
|
|
local.userDescription = "NixOS PRG Minecraft Service";
|
|
local.address = "10.1.1.244";
|
|
|
|
services.tailscale.enable = true;
|
|
|
|
networking.firewall.allowedTCPPorts = [25565 24454];
|
|
networking.firewall.allowedUDPPorts = [25565 24454];
|
|
|
|
# 24454 - https://modrepo.de/minecraft/voicechat/wiki/server_setup_self_hosted !!!
|
|
# This is the VoiceChat mod in Minecraft
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Minecraft server configuration (nix-minecraft)
|
|
# ---------------------------------------------------------------------------
|
|
services.minecraft-servers = {
|
|
enable = true;
|
|
eula = true;
|
|
openFirewall = true;
|
|
|
|
servers.fabric-modded = {
|
|
enable = true;
|
|
autoStart = true;
|
|
restart = "always";
|
|
|
|
package = pkgs.fabricServers.fabric-1_21_11.override {
|
|
loaderVersion = "0.18.4";
|
|
};
|
|
|
|
jvmOpts = lib.concatStringsSep " " [
|
|
"-Xms6048M"
|
|
# Use 120GB of RAM
|
|
"-Xmx12288M"
|
|
];
|
|
|
|
serverProperties = {
|
|
server-port = 25565;
|
|
motd = "PRG Fabric Modded Server";
|
|
difficulty = "hard";
|
|
gamemode = "survival";
|
|
max-players = 64;
|
|
online-mode = true;
|
|
white-list = false;
|
|
spawn-protection = 4;
|
|
view-distance = 10;
|
|
simulation-distance = 8;
|
|
enable-command-block = false;
|
|
enable-rcon = false;
|
|
};
|
|
|
|
# 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 = pkgs.linkFarmFromDrvs "mods" (
|
|
builtins.attrValues {
|
|
Fabric-API = pkgs.fetchurl {
|
|
url = "https://cdn.modrinth.com/data/P7dR8mSH/versions/i5tSkVBH/fabric-api-0.141.3%2B1.21.11.jar";
|
|
sha512 = "c20c017e23d6d2774690d0dd774cec84c16bfac5461da2d9345a1cd95eee495b1954333c421e3d1c66186284d24a433f6b0cced8021f62e0bfa617d2384d0471";
|
|
};
|
|
Lithium = pkgs.fetchurl {
|
|
url = "https://cdn.modrinth.com/data/gvQqBUqZ/versions/Ow7wA0kG/lithium-fabric-0.21.4%2Bmc1.21.11.jar";
|
|
sha512 = "f14a5c3d2fad786347ca25083f902139694f618b7c103947f2fd067a7c5ee88a63e1ef8926f7d693ea79ed7d00f57317bae77ef9c2d630bf5ed01ac97a752b94";
|
|
};
|
|
|
|
LetMeDespawn = pkgs.fetchurl {
|
|
url = "https://cdn.modrinth.com/data/vE2FN5qn/versions/7gmpSYHk/LetMeDespawn-1.21.11-x-fabric-1.6.2.jar";
|
|
sha512 = "e0a03faef8bc3e94de34be71b0e0c3a3129a65baf2290483d64637547bc6008b8658231be268342b98e4f0405c57e64b1a84c42185fbd043bec39c185a71cb48";
|
|
};
|
|
|
|
Clumps = pkgs.fetchurl {
|
|
url = "https://cdn.modrinth.com/data/Wnxd13zP/versions/OgBE8Rz4/Clumps-fabric-1.21.11-29.0.0.1.jar";
|
|
sha512 = "3cff3cd2d600a6d84030b38ce6244143d13774d5287627bb7312adae5edc7ae2d9151a2c9c39a00681c354d549b0a62ac48c0077ba586cc10c00d32f39e87f18";
|
|
};
|
|
|
|
FerriteCore = pkgs.fetchurl {
|
|
url = "https://cdn.modrinth.com/data/uXXizFIs/versions/Ii0gP3D8/ferritecore-8.2.0-fabric.jar";
|
|
sha512 = "3210926a82eb32efd9bcebabe2f6c053daf5c4337eebc6d5bacba96d283510afbde646e7e195751de795ec70a2ea44fef77cb54bf22c8e57bb832d6217418869";
|
|
};
|
|
|
|
Terralith = pkgs.fetchurl {
|
|
url = "https://cdn.modrinth.com/data/8oi3bsk5/versions/94lWUKHj/Terralith_1.21.11_v2.6.0_Fabric.jar";
|
|
sha512 = "3513374822c9181e2ec6e95ea04e0533d837934b6fe02165f3bc1b7752eff14972d094fce840355928ffa27844bf456ca6bb2cc968c5ad147601a64de1005c09";
|
|
};
|
|
|
|
Chunky = pkgs.fetchurl {
|
|
url = "https://cdn.modrinth.com/data/fALzjamp/versions/1CpEkmcD/Chunky-Fabric-1.4.55.jar";
|
|
sha512 = "3be0e049e3dea6256b395ccb1f7dccc9c6b23cb7b1f6a717a7cd1ca55f9dbda489679df32868c72664ebb28ca05f2c366590d1e1a11f0dc5f69f947903bad833";
|
|
};
|
|
|
|
AppleSkin = pkgs.fetchurl {
|
|
url = "https://cdn.modrinth.com/data/EsAfCjCV/versions/59ti1rvg/appleskin-fabric-mc1.21.11-3.0.8.jar";
|
|
sha512 = "d32206cb8d6fac7f0b579f7269203135777283e1639ccb68f8605e9f5469b5b54305fd36ba82c64b48b89ae4f1a38501bfb5827284520c3ec622d95edcfa34de";
|
|
};
|
|
|
|
SimpleVoiceChat = pkgs.fetchurl {
|
|
url = "https://cdn.modrinth.com/data/9eGKb6K1/versions/pFTZ8sqQ/voicechat-fabric-1.21.11-2.6.12.jar";
|
|
sha512 = "afc78e3d8ca463fb783b00ec3d4cb938ff9249f088d077f8cd75f6c846419e0fe4916061f57a0b188a5c28565c934623c52113f476e69e82aecabaffc8e8fdcc";
|
|
};
|
|
}
|
|
);
|
|
};
|
|
};
|
|
};
|
|
|
|
# The nix-minecraft module creates the `minecraft` user/group automatically.
|
|
users.users.minecraftprg.extraGroups = ["minecraft"];
|
|
|
|
system.stateVersion = "25.11";
|
|
};
|
|
}
|