Files
hearth/nixos/system/neuro/minecraft/world-of-sosal.nix
T
2026-11-17 23:14:53 +00:00

55 lines
2.2 KiB
Nix

{ config, pkgs, ... }:
let
packVersion = "v13-lootplus-cleanup";
serverDir = "${config.services.minecraft-servers.dataDir}/wowMineMap";
serverMotd = "WoS | Warcraft";
in
{
sops.secrets."minecraft/storage-box-pack-key" = {
sopsFile = ../../../../sus/neuro-minecraft.yaml;
owner = "mc-pack-worldOfSosal";
group = "mc-pack-worldOfSosal";
mode = "0400";
};
services.minecraft-modpack-imports.worldOfSosal = {
enable = true;
serverName = "wowMineMap";
remoteHost = "u664722.your-storagebox.de";
remoteUser = "u664722";
remotePath = "minecraft/pack/WorldOfSosal-${packVersion}.mrpack";
archiveName = "WorldOfSosal.mrpack";
cacheDir = "/var/lib/minecraft-modpacks/worldOfSosal";
archiveSha256 = "e5895994e95a4df476d7da00b53c39d0372885265acb6cf9b5a9647a015db5f7";
expectedDependencies = {
minecraft = "1.21.1";
neoforge = "21.1.250";
};
sshKeyFile = config.sops.secrets."minecraft/storage-box-pack-key".path;
hostPublicKey = "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5EB5p/5Hp3hGW1oHok+PIOH9Pbn7cnUiGmUEBrCVjnAw+HrKyN8bYVV0dIGllswYXwkG/+bgiBlE6IVIBAq+JwVWu1Sss3KarHY3OvFJUXZoZyRRg/Gc/+LRCE7lyKpwWQ70dbelGRyyJFH36eNv6ySXoUYtGkwlU5IVaHPApOxe4LHPZa/qhSRbPo2hwoh0orCtgejRebNtW5nlx00DNFgsvn8Svz2cIYLxsPVzKgUxs8Zxsxgn+Q/UvR7uq4AbAhyBMLxv7DjJ1pc7PJocuTno2Rw9uMZi1gkjbnmiOh6TTXIEWbnroyIhwc8555uto9melEUmWNQ+C+PwAK+MPw==";
};
services.minecraft-servers.servers.wowMineMap.serverProperties.motd =
serverMotd;
systemd.services.minecraft-server-wowMineMap.preStart =
(import ./world-of-sosal-settings.nix {
inherit pkgs serverDir;
namesOnly = true;
}) + ''
${pkgs.gnused}/bin/sed -i \
's/^motd=.*/motd=${serverMotd}/' "${serverDir}/server.properties"
'';
# Import the map before writing modpack configuration into the same server.
systemd.services.minecraft-modpack-import-worldOfSosal = {
after = [ "minecraft-world-import-wowMineMap.service" ];
requires = [ "minecraft-world-import-wowMineMap.service" ];
# Test the map's native dimension height without runtime height overrides.
postStart = import ./world-of-sosal-settings.nix {
inherit pkgs serverDir;
};
};
}