diff --git a/modules/nixos/minecraft/java.nix b/modules/nixos/minecraft/java.nix index 33e6186a..6668f719 100644 --- a/modules/nixos/minecraft/java.nix +++ b/modules/nixos/minecraft/java.nix @@ -146,13 +146,15 @@ in { map (argsFile: "@${argsFile}") cfg.argsFiles ++ cfg.jvmOpts; execStop = pkgs.writeShellScriptBin "minecraft-java-stop" '' - echo /stop > ${config.systemd.sockets.minecraft-java-server.socketConfig.ListenFIFO} + echo /stop > ${config.systemd.sockets.minecraft-java-server.socketConfig.ListenFIFO} || true - # Wait for the PID of the minecraft server to disappear before - # returning, so systemd doesn't attempt to SIGKILL it. - while kill -0 "$1" 2> /dev/null; do - sleep 1s - done + if [[ -n $1 ]]; then + # Wait for the PID of the minecraft server to disappear before + # returning, so systemd doesn't attempt to SIGKILL it. + while kill -0 "$1" 2> /dev/null; do + sleep 1s + done + fi ''; in { description = "Minecraft Kat Kitchen Server"; @@ -177,7 +179,7 @@ in { "${writeWhiteList cfg.allowPlayers}:${cfg.dataDir}/whitelist.json" "${writeOps cfg.allowPlayers}:${cfg.dataDir}/ops.json" ]; - ExecStop = "${getExe execStop} $MAINPID"; + ExecStop = ''${getExe execStop} "$MAINPID"''; Restart = "always"; User = cfg.user; WorkingDirectory = cfg.dataDir; diff --git a/nixos/minecraft/java.nix b/nixos/minecraft/java.nix index c465fa54..60549324 100644 --- a/nixos/minecraft/java.nix +++ b/nixos/minecraft/java.nix @@ -22,7 +22,10 @@ owner = "kittywitch"; repo = "minecraft-modpack"; branch = "marka-${versions.majorMinor mcVersion}"; - packUrl = "https://raw.githubusercontent.com/${owner}/${repo}/refs/heads/${branch}/pack.toml"; + pages = true; + packUrl = if pages + then "https://${owner}.github.io/${repo}/pack.toml" + else "https://raw.githubusercontent.com/${owner}/${repo}/refs/heads/${branch}/pack.toml"; }; in { services.minecraft-java-server = {