From e904e249ed5cb0f5d52f2bfd452da60e2fcf5740 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Sun, 12 Apr 2026 22:26:07 -0400 Subject: [PATCH] recyclarr: ensure restart on config change --- services/arr/recyclarr.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/services/arr/recyclarr.nix b/services/arr/recyclarr.nix index 62b3359..ebddbce 100644 --- a/services/arr/recyclarr.nix +++ b/services/arr/recyclarr.nix @@ -190,9 +190,19 @@ in }; }; - # Re-sync immediately on deploy when the recyclarr config changes + # Trigger immediate sync on deploy when recyclarr config changes. + # restartTriggers on the oneshot service are unreliable (systemd may + # no-op a restart of an inactive oneshot). Instead, embed a config + # hash in the timer unit -- NixOS restarts changed timers reliably, + # and OnActiveSec fires the sync within seconds. + systemd.timers.recyclarr = { + timerConfig.OnActiveSec = "5s"; + unitConfig.X-ConfigHash = builtins.hashString "sha256" ( + builtins.toJSON config.services.recyclarr.configuration + ); + }; + systemd.services.recyclarr = { - restartTriggers = [ (builtins.toJSON config.services.recyclarr.configuration) ]; after = [ "network-online.target" "radarr.service"