soulseek: added auto restart
This commit is contained in:
parent
cf90158871
commit
48ce3dfa79
|
@ -46,6 +46,9 @@ in
|
|||
EOF 200
|
||||
'';
|
||||
|
||||
# Minecraft only autoupdates at startup
|
||||
#
|
||||
# To keep up with the update, restart the server at 4am everyday.
|
||||
systemd =
|
||||
let serviceName = "podman-${name}"; in
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ config, lib, ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
name = "soulseek";
|
||||
podman = config.profile.podman;
|
||||
|
@ -23,6 +23,32 @@ in
|
|||
chown ${uid}:${gid} ${rootVolume} ${rootVolume}/{config,downloads,incomplete}
|
||||
'';
|
||||
|
||||
|
||||
# Soulseek only autoscans on startup
|
||||
#
|
||||
# Once a day at 4am, restart the container to trigger a rescan
|
||||
systemd =
|
||||
let
|
||||
serviceName = "podman-${name}-autorestart";
|
||||
in
|
||||
{
|
||||
services.${serviceName} = {
|
||||
description = "Podman container ${name} autorestart";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${pkgs.podman}/bin/podman restart ${name}";
|
||||
};
|
||||
};
|
||||
timers.${serviceName} = {
|
||||
description = "Podman container ${name} autorestart";
|
||||
timerConfig = {
|
||||
OnCalendar = "*-*-* 04:00:00";
|
||||
};
|
||||
wantedBy = [ "timers.target" ];
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
virtualisation.oci-containers.containers.${name} = {
|
||||
inherit image;
|
||||
hostname = name;
|
||||
|
|
Loading…
Reference in a new issue