diff --git a/configuration/services/minecraft.nix b/configuration/services/minecraft.nix index 9b77c09..02bcdc3 100644 --- a/configuration/services/minecraft.nix +++ b/configuration/services/minecraft.nix @@ -91,6 +91,7 @@ in { }; autoStart = false; + extraOptions = [ "-i" ]; ports = [ "25565:25565" ]; volumes = [ "minecraft:/var/lib/minecraft" @@ -101,4 +102,17 @@ in { "${whitelist}:/var/lib/minecraft/whitelist.json:ro" ]; }; + + systemd.services.restart-minecraft-voor-kia = { + script = '' + #!${pkgs.runtimeShell} + set -eu + ${pkgs.systemd}/bin/systemctl try-restart podman-minecraft-voor-kia.service + ''; + }; + + systemd.timers.restart-minecraft-voor-kia = { + requiredBy = [ "podman-minecraft-voor-kia.service" ]; + timerConfig = { OnCalendar = "daily"; }; + }; }