From 88b506b08c1bfe2739293d670c919e7a78b0a7b1 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Wed, 18 Feb 2026 20:45:32 -0500 Subject: [PATCH] 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. --- configuration.nix | 1 + flake.nix | 4 ++++ services/recyclarr.nix | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 services/recyclarr.nix diff --git a/configuration.nix b/configuration.nix index 80b212e..ef218c9 100644 --- a/configuration.nix +++ b/configuration.nix @@ -37,6 +37,7 @@ ./services/radarr.nix ./services/bazarr.nix ./services/jellyseerr.nix + ./services/recyclarr.nix ./services/soulseek.nix diff --git a/flake.nix b/flake.nix index c71e3fe..1ab9a59 100644 --- a/flake.nix +++ b/flake.nix @@ -219,6 +219,10 @@ configDir = services_dir + "/jellyseerr"; }; + recyclarr = { + dataDir = services_dir + "/recyclarr"; + }; + media = { moviesDir = torrents_path + "/media/movies"; tvDir = torrents_path + "/media/tv"; diff --git a/services/recyclarr.nix b/services/recyclarr.nix new file mode 100644 index 0000000..09c644b --- /dev/null +++ b/services/recyclarr.nix @@ -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"; + }; + }; +}