feat: transfer wowmine to neuro
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
serverDir = "${config.services.minecraft-servers.dataDir}/wowMineMap";
|
||||
stateDir = "/var/lib/worldofsosal-bluemap";
|
||||
stateDir = "/var/lib/wowmine-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";
|
||||
systemd.services.wowmine-bluemap = {
|
||||
description = "wowmine live Azeroth and Outland 3D maps";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
wants = [ "network-online.target" ];
|
||||
after = [ "network-online.target" "minecraft-server-wowMineMap.service" ];
|
||||
@@ -21,7 +21,7 @@ in {
|
||||
serviceConfig = {
|
||||
User = "minecraft";
|
||||
Group = "minecraft";
|
||||
StateDirectory = "worldofsosal-bluemap";
|
||||
StateDirectory = "wowmine-bluemap";
|
||||
StateDirectoryMode = "0750";
|
||||
WorkingDirectory = stateDir;
|
||||
ExecCondition = "${pkgs.runtimeShell} -ec '${builtins.replaceStrings [ "$" ] [ "$$" ] diskCheck}'";
|
||||
@@ -47,17 +47,17 @@ in {
|
||||
TimeoutStopSec = 120;
|
||||
};
|
||||
};
|
||||
systemd.services.worldofsosal-bluemap-space-guard = {
|
||||
systemd.services.wowmine-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
|
||||
${pkgs.systemd}/bin/systemctl stop wowmine-bluemap.service
|
||||
fi
|
||||
'';
|
||||
};
|
||||
systemd.timers.worldofsosal-bluemap-space-guard = {
|
||||
systemd.timers.wowmine-bluemap-space-guard = {
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
OnBootSec = "1min";
|
||||
|
||||
Reference in New Issue
Block a user