feat: wowmine: map
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
serverDir = "${config.services.minecraft-servers.dataDir}/wowMineMap";
|
||||
stateDir = "/var/lib/worldofsosal-bluemap";
|
||||
diskCheck = "${pkgs.coreutils}/bin/test $(${pkgs.coreutils}/bin/df -B1 --output=avail ${stateDir} | ${pkgs.coreutils}/bin/tail -n1) -ge 21474836480";
|
||||
jar = pkgs.fetchurl {
|
||||
url = "https://github.com/BlueMap-Minecraft/BlueMap/releases/download/v5.29/bluemap-5.29-cli.jar";
|
||||
sha256 = "e830767fa6364b52b9310fb598508ebde7eec5ebe8360a989e240d991af89a3a";
|
||||
};
|
||||
in {
|
||||
systemd.services.worldofsosal-bluemap = {
|
||||
description = "WorldOfSosal live Azeroth and Outland 3D maps";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
wants = [ "network-online.target" ];
|
||||
after = [ "network-online.target" "minecraft-server-wowMineMap.service" ];
|
||||
unitConfig.ConditionPathIsDirectory = "${serverDir}/world";
|
||||
preStart = ''
|
||||
${pkgs.coreutils}/bin/mkdir -p "${stateDir}/config"
|
||||
${pkgs.coreutils}/bin/cp -r --no-preserve=mode ${./bluemap}/. "${stateDir}/config/"
|
||||
'';
|
||||
serviceConfig = {
|
||||
User = "minecraft";
|
||||
Group = "minecraft";
|
||||
StateDirectory = "worldofsosal-bluemap";
|
||||
StateDirectoryMode = "0750";
|
||||
WorkingDirectory = stateDir;
|
||||
ExecCondition = "${pkgs.runtimeShell} -ec '${builtins.replaceStrings [ "$" ] [ "$$" ] diskCheck}'";
|
||||
ExecStart = "${pkgs.jdk25}/bin/java -Xms512m -Xmx3g -XX:ActiveProcessorCount=2 -Djava.awt.headless=true -jar ${jar} -c ${stateDir}/config -n ${serverDir}/mods -v 1.21.1 -r -u -w -g -s";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 15;
|
||||
CPUQuota = "200%";
|
||||
CPUWeight = 10;
|
||||
MemoryHigh = "4G";
|
||||
MemoryMax = "5G";
|
||||
Nice = 10;
|
||||
IOSchedulingClass = "idle";
|
||||
NoNewPrivileges = true;
|
||||
ProtectSystem = "strict";
|
||||
ProtectHome = true;
|
||||
PrivateTmp = true;
|
||||
ReadOnlyPaths = [ serverDir ];
|
||||
InaccessiblePaths = [ "${serverDir}/server.properties" "${serverDir}/config" ];
|
||||
RestrictSUIDSGID = true;
|
||||
LockPersonality = true;
|
||||
CapabilityBoundingSet = "";
|
||||
UMask = "0027";
|
||||
TimeoutStopSec = 120;
|
||||
};
|
||||
};
|
||||
systemd.services.worldofsosal-bluemap-space-guard = {
|
||||
description = "Keep 20 GiB free for Minecraft while rendering maps";
|
||||
serviceConfig.Type = "oneshot";
|
||||
script = ''
|
||||
if ! ${diskCheck}; then
|
||||
echo "Stopping only BlueMap: less than 20 GiB free on map filesystem"
|
||||
${pkgs.systemd}/bin/systemctl stop worldofsosal-bluemap.service
|
||||
fi
|
||||
'';
|
||||
};
|
||||
systemd.timers.worldofsosal-bluemap-space-guard = {
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
OnBootSec = "1min";
|
||||
OnUnitActiveSec = "1min";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
accept-download: true
|
||||
data: "/var/lib/worldofsosal-bluemap/data"
|
||||
render-thread-count: 2
|
||||
update-cooldown: 60
|
||||
full-update-interval: 1440
|
||||
region-file-check-interval: 5
|
||||
scan-for-mod-resources: true
|
||||
metrics: false
|
||||
log: {
|
||||
file: "/var/lib/worldofsosal-bluemap/data/logs/debug.log"
|
||||
append: true
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
world: "/srv/minecraft/wowMineMap/world"
|
||||
dimension: "crafting_azeroth:azeroth"
|
||||
name: "Азерот"
|
||||
sorting: 0
|
||||
start-pos: { x: 3742, z: 8891 }
|
||||
sky-color: "#7dabff"
|
||||
void-color: "#000000"
|
||||
sky-light: 1
|
||||
ambient-light: 0.1
|
||||
remove-caves-below-y: -10000
|
||||
render-mask: []
|
||||
storage: "file"
|
||||
@@ -0,0 +1,12 @@
|
||||
world: "/srv/minecraft/wowMineMap/world"
|
||||
dimension: "crafting_azeroth:outland"
|
||||
name: "Запределье"
|
||||
sorting: 1
|
||||
start-pos: { x: -54520, z: -2296 }
|
||||
sky-color: "#281c46"
|
||||
void-color: "#080010"
|
||||
sky-light: 1
|
||||
ambient-light: 0.6
|
||||
remove-caves-below-y: -10000
|
||||
render-mask: []
|
||||
storage: "file"
|
||||
@@ -0,0 +1,3 @@
|
||||
storage-type: file
|
||||
root: "/var/lib/worldofsosal-bluemap/web/maps"
|
||||
compression: gzip
|
||||
@@ -0,0 +1,14 @@
|
||||
enabled: true
|
||||
webroot: "/var/lib/worldofsosal-bluemap/web"
|
||||
update-settings-file: true
|
||||
use-cookies: true
|
||||
default-to-flat-view: false
|
||||
min-zoom-distance: 5
|
||||
max-zoom-distance: 100000
|
||||
resolution-default: 1
|
||||
hires-slider-max: 500
|
||||
hires-slider-default: 100
|
||||
hires-slider-min: 0
|
||||
lowres-slider-max: 7000
|
||||
lowres-slider-default: 2000
|
||||
lowres-slider-min: 500
|
||||
@@ -0,0 +1,13 @@
|
||||
enabled: true
|
||||
webroot: "/var/lib/worldofsosal-bluemap/web"
|
||||
ip: "127.0.0.1"
|
||||
port: 8100
|
||||
sse-enabled: true
|
||||
additional-headers: {
|
||||
"Cache-Control": "no-cache"
|
||||
"X-Content-Type-Options": "nosniff"
|
||||
}
|
||||
log: {
|
||||
file: "/var/lib/worldofsosal-bluemap/data/logs/webserver.log"
|
||||
append: true
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
./create-aeronautics.nix
|
||||
./wow-mine-map.nix
|
||||
./world-of-sosal.nix
|
||||
./bluemap.nix
|
||||
./backup-restore-test.nix
|
||||
./public-tunnel.nix
|
||||
./world-import.nix
|
||||
|
||||
Reference in New Issue
Block a user