From 1f9edc6e8fe0d88a31719f57bcc3977894cd9c2b Mon Sep 17 00:00:00 2001 From: Ciapa Date: Fri, 21 Apr 2023 19:00:42 +0000 Subject: [PATCH] Run qbittools every 2 hours --- hosts/kinda.sus.lol/services/qbittorrent.nix | 21 ++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/hosts/kinda.sus.lol/services/qbittorrent.nix b/hosts/kinda.sus.lol/services/qbittorrent.nix index 43a1588..741035e 100644 --- a/hosts/kinda.sus.lol/services/qbittorrent.nix +++ b/hosts/kinda.sus.lol/services/qbittorrent.nix @@ -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"; + }; + }; }