82 lines
3.4 KiB
Nix
82 lines
3.4 KiB
Nix
{ config, pkgs, ... }:
|
|
|
|
let
|
|
packVersion = "v17-immersive-portals";
|
|
serverDir = "${config.services.minecraft-servers.dataDir}/wowMineMap";
|
|
serverMotd = "wowmine | Warcraft";
|
|
immersivePortals = pkgs.fetchurl {
|
|
url = "https://github.com/UpperMoon0/ImmersivePortals/releases/download/v6.1.3.1/immersive_portals-6.1.3.1.jar";
|
|
hash = "sha256-2i+h2Q6uAx40aQpkyc117Tt01HMlgl+POMBBnhIgvKI=";
|
|
};
|
|
worldPolicy = import ./wowmine-world-policy {
|
|
inherit pkgs immersivePortals;
|
|
server = config.services.minecraft-servers.servers.wowMineMap.package;
|
|
};
|
|
sleepTimeSkip = pkgs.fetchurl {
|
|
url = "https://edge.forgecdn.net/files/9527/851/sleeptimeskip-neoforge-1.21.1-1.1.0.jar";
|
|
hash = "sha256-VXyBWvU+P95RMNRs2vTUFcqQPBeit2oJDTbSngwXAIM=";
|
|
};
|
|
in
|
|
{
|
|
sops.secrets."minecraft/storage-box-pack-key" = {
|
|
sopsFile = ../../../../sus/neuro-minecraft.yaml;
|
|
owner = "mc-pack-wowmine";
|
|
group = "mc-pack-wowmine";
|
|
mode = "0400";
|
|
};
|
|
|
|
services.minecraft-modpack-imports.wowmine = {
|
|
enable = true;
|
|
serverName = "wowMineMap";
|
|
remoteHost = "u664722.your-storagebox.de";
|
|
remoteUser = "u664722";
|
|
remotePath = "minecraft/pack/wowmine-${packVersion}.mrpack";
|
|
archiveName = "wowmine.mrpack";
|
|
cacheDir = "/var/lib/minecraft-modpacks/wowmine";
|
|
archiveSha256 = "f958597c4bed2da74d3e4c1d52b2773e2292fb9c3d1a4f42ccda76b9c620a9de";
|
|
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;
|
|
|
|
services.minecraft-backups.servers.wowMineMap.announcementCommand =
|
|
pkgs.writeShellScript "wowmine-backup-announce" ''
|
|
set -eu
|
|
${pkgs.tmux}/bin/tmux -S /run/minecraft/wowMineMap.sock \
|
|
send-keys C-u "say $1" Enter
|
|
'';
|
|
|
|
systemd.services.minecraft-server-wowMineMap.preStart =
|
|
(import ./wowmine-settings.nix {
|
|
inherit pkgs serverDir;
|
|
namesOnly = true;
|
|
}) + ''
|
|
${pkgs.coreutils}/bin/install -Dm444 \
|
|
${worldPolicy}/share/java/wowmine-world-policy.jar \
|
|
"${serverDir}/mods/wowmine-world-policy.jar"
|
|
${pkgs.coreutils}/bin/install -Dm444 \
|
|
${sleepTimeSkip} "${serverDir}/mods/wowmine-sleep-time-skip.jar"
|
|
${pkgs.coreutils}/bin/cp -rT --no-preserve=mode \
|
|
${./wowmine-server-config} "${serverDir}/config"
|
|
${pkgs.coreutils}/bin/mkdir -p "${serverDir}/world/datapacks/wowmine-rules"
|
|
${pkgs.coreutils}/bin/cp -rT --no-preserve=mode \
|
|
${./wowmine-rules} "${serverDir}/world/datapacks/wowmine-rules"
|
|
'';
|
|
|
|
# Import the map before writing modpack configuration into the same server.
|
|
systemd.services.minecraft-modpack-import-wowmine = {
|
|
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 ./wowmine-settings.nix {
|
|
inherit pkgs serverDir;
|
|
};
|
|
};
|
|
}
|