From d44c7be1a35ba8b0eb555515be02a7c2e70d38ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tristan=20Dani=C3=ABl=20Maat?= Date: Mon, 17 May 2021 00:34:52 +0100 Subject: [PATCH] WIP: minecraft: Add daily restart timer --- configuration/services/minecraft.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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"; }; + }; }