feat(media): add recyclarr service for automated TRaSH Guides sync
Add systemd oneshot + daily timer to sync TRaSH Guides quality profiles and custom formats to Radarr/Sonarr via recyclarr.
This commit is contained in:
39
services/recyclarr.nix
Normal file
39
services/recyclarr.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
service_configs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
(lib.serviceMountWithZpool "recyclarr" service_configs.zpool_ssds [
|
||||
service_configs.recyclarr.dataDir
|
||||
])
|
||||
];
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"d ${service_configs.recyclarr.dataDir} 0755 root root -"
|
||||
"d ${service_configs.recyclarr.dataDir}/data 0755 root root -"
|
||||
];
|
||||
|
||||
systemd.services.recyclarr = {
|
||||
description = "Recyclarr TRaSH Guides Sync";
|
||||
after = [ "network-online.target" "radarr.service" "sonarr.service" ];
|
||||
wants = [ "network-online.target" ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${pkgs.recyclarr}/bin/recyclarr sync --config ${service_configs.recyclarr.dataDir}/recyclarr.yml --app-data ${service_configs.recyclarr.dataDir}/data";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.timers.recyclarr = {
|
||||
description = "Run Recyclarr daily";
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
OnCalendar = "daily";
|
||||
Persistent = true;
|
||||
RandomizedDelaySec = "1h";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user