torrent-audit: init
This commit is contained in:
40
services/arr/torrent-audit.nix
Normal file
40
services/arr/torrent-audit.nix
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
service_configs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
systemd.services.torrent-audit = {
|
||||
description = "Audit qBittorrent for unmanaged and abandoned upgrade torrents";
|
||||
after = [
|
||||
"network-online.target"
|
||||
"sonarr.service"
|
||||
"radarr.service"
|
||||
"qbittorrent.service"
|
||||
];
|
||||
wants = [ "network-online.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "+${
|
||||
pkgs.python3.withPackages (
|
||||
ps: with ps; [
|
||||
pyarr
|
||||
qbittorrent-api
|
||||
]
|
||||
)
|
||||
}/bin/python ${./torrent-audit.py}";
|
||||
TimeoutSec = 300;
|
||||
};
|
||||
|
||||
environment = {
|
||||
QBITTORRENT_URL = "http://${config.vpnNamespaces.wg.namespaceAddress}:${builtins.toString service_configs.ports.private.torrent.port}";
|
||||
RADARR_URL = "http://localhost:${builtins.toString service_configs.ports.private.radarr.port}";
|
||||
RADARR_CONFIG = "${service_configs.radarr.dataDir}/config.xml";
|
||||
SONARR_URL = "http://localhost:${builtins.toString service_configs.ports.private.sonarr.port}";
|
||||
SONARR_CONFIG = "${service_configs.sonarr.dataDir}/config.xml";
|
||||
CATEGORIES = "tvshows,movies,anime";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user