WIP: minecraft: Add daily restart timer

This commit is contained in:
Tristan Daniël Maat 2021-05-17 00:34:52 +01:00
parent 4c94932490
commit d44c7be1a3
Signed by: tlater
GPG key ID: 49670FD774E43268

View file

@ -91,6 +91,7 @@ in {
}; };
autoStart = false; autoStart = false;
extraOptions = [ "-i" ];
ports = [ "25565:25565" ]; ports = [ "25565:25565" ];
volumes = [ volumes = [
"minecraft:/var/lib/minecraft" "minecraft:/var/lib/minecraft"
@ -101,4 +102,17 @@ in {
"${whitelist}:/var/lib/minecraft/whitelist.json:ro" "${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"; };
};
} }