Run qbittools every 2 hours

This commit is contained in:
Ciapa 2023-04-21 19:00:42 +00:00
parent aeb4b989b2
commit 1f9edc6e8f
1 changed files with 21 additions and 0 deletions

View File

@ -1,3 +1,4 @@
{ pkgs, ... }:
{
imports =
[
@ -38,4 +39,24 @@
};
};
};
systemd.timers."qbittools-unregistered" = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnBootSec = "5m";
OnUnitActiveSec = "2h";
Unit = "qbittools-unregistered.service";
};
};
systemd.services."qbittools-unregistered" = {
script = ''
set -eu
${pkgs.podman}/bin/podman run -it --rm --network host registry.gitlab.com/alexkm/qbittools@sha256:74fe59f3ef0c23e48db3b2af34a5b1f8b43a4afd3dbf45df7529e300a6f50820 tagging --unregistered --port 8888 -s 127.0.0.1
'';
serviceConfig = {
Type = "oneshot";
User= "nobody";
};
};
}