about summary refs log tree commit diff
path: root/modules/piracy/sonarr.nix
diff options
context:
space:
mode:
authorazahi <azat@bahawi.net>2025-03-12 20:17:13 +0300
committerazahi <azat@bahawi.net>2025-03-12 20:17:13 +0300
commitc81dc5a13b469c511fac6fa2390b70422d1b4da5 (patch)
tree4dab5909006ab5c25da6bd9fde6a714c7719ded7 /modules/piracy/sonarr.nix
parent2025-02-17 (diff)
2025-03-12 HEAD master
Diffstat (limited to '')
-rw-r--r--modules/piracy/sonarr.nix15
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/piracy/sonarr.nix b/modules/piracy/sonarr.nix
index 0761a3d..5440bf4 100644
--- a/modules/piracy/sonarr.nix
+++ b/modules/piracy/sonarr.nix
@@ -61,7 +61,22 @@ in
       };
     };
 
+    environment.etc."alloy/sonarr.alloy".text =
+      with config.services.prometheus.exporters.exportarr-sonarr; ''
+        prometheus.scrape "sonarr" {
+          targets = [
+            {
+              __address__ = "${listenAddress}:${toString port}",
+              instance    = "${config.networking.hostName}",
+            }
+          ]
+          forward_to = [prometheus.relabel.default.receiver]
+        }
+      '';
+
     systemd = {
+      services.alloy.reloadTriggers = [ config.environment.etc."alloy/sonarr.alloy".source ];
+
       tmpfiles.rules = with config.services.sonarr; [
         "d /var/lib/sonarr/root 0755 ${user} ${group} - -"
       ];

Consider giving Nix/NixOS a try! <3