diff options
author | azahi <azat@bahawi.net> | 2025-03-12 20:17:13 +0300 |
---|---|---|
committer | azahi <azat@bahawi.net> | 2025-03-12 20:17:13 +0300 |
commit | c81dc5a13b469c511fac6fa2390b70422d1b4da5 (patch) | |
tree | 4dab5909006ab5c25da6bd9fde6a714c7719ded7 /modules/piracy | |
parent | 2025-02-17 (diff) |
Diffstat (limited to 'modules/piracy')
-rw-r--r-- | modules/piracy/lidarr.nix | 17 | ||||
-rw-r--r-- | modules/piracy/prowlarr.nix | 17 | ||||
-rw-r--r-- | modules/piracy/radarr.nix | 17 | ||||
-rw-r--r-- | modules/piracy/sonarr.nix | 15 |
4 files changed, 63 insertions, 3 deletions
diff --git a/modules/piracy/lidarr.nix b/modules/piracy/lidarr.nix index 400ba9f..fd95b04 100644 --- a/modules/piracy/lidarr.nix +++ b/modules/piracy/lidarr.nix @@ -56,12 +56,27 @@ in apiKeyFile = config.secrets.lidarr-api-key.path; inherit (config.services.lidarr) user; inherit (config.services.lidarr) group; - listenAddress = this.wireguard.ipv4.address; + listenAddress = "127.0.0.1"; environment.CONFIG = "/var/lib/lidarr/.config/Lidarr/config.xml"; }; }; + environment.etc."alloy/lidarr.alloy".text = + with config.services.prometheus.exporters.exportarr-lidarr; '' + prometheus.scrape "lidarr" { + targets = [ + { + __address__ = "${listenAddress}:${toString port}", + instance = "${config.networking.hostName}", + }, + ] + forward_to = [prometheus.relabel.default.receiver] + } + ''; + systemd = { + services.alloy.reloadTriggers = [ config.environment.etc."alloy/lidarr.alloy".source ]; + tmpfiles.rules = with config.services.lidarr; [ "d /var/lib/lidarr/root 0755 ${user} ${group} - -" ]; diff --git a/modules/piracy/prowlarr.nix b/modules/piracy/prowlarr.nix index ebcba7f..c1c34cc 100644 --- a/modules/piracy/prowlarr.nix +++ b/modules/piracy/prowlarr.nix @@ -44,7 +44,7 @@ in url = "http://127.0.0.1"; port = port + 10000; apiKeyFile = config.secrets.lidarr-api-key.path; - listenAddress = this.wireguard.ipv4.address; + listenAddress = "127.0.0.1"; environment = { PROWLARR__BACKFILL = "true"; PROWLARR__BACKFILL_DATE_SINCE = "2025-01-01"; @@ -52,6 +52,21 @@ in }; }; + environment.etc."alloy/prowlarr.alloy".text = + with config.services.prometheus.exporters.exportarr-prowlarr; '' + prometheus.scrape "prowlarr" { + targets = [ + { + __address__ = "${listenAddress}:${toString port}", + instance = "${config.networking.hostName}", + } + ] + forward_to = [prometheus.relabel.default.receiver] + } + ''; + + systemd.services.alloy.reloadTriggers = [ config.environment.etc."alloy/prowlarr.alloy".source ]; + topology.nodes.${this.hostname}.services.prowlarr = { name = "Prowlarr"; icon = "${inputs.homelab-svg-assets}/assets/prowlarr.svg"; diff --git a/modules/piracy/radarr.nix b/modules/piracy/radarr.nix index 12f8d95..ee777d5 100644 --- a/modules/piracy/radarr.nix +++ b/modules/piracy/radarr.nix @@ -56,12 +56,27 @@ in apiKeyFile = config.secrets.radarr-api-key.path; inherit (config.services.radarr) user; inherit (config.services.radarr) group; - listenAddress = this.wireguard.ipv4.address; + listenAddress = "127.0.0.1"; environment.CONFIG = "/var/lib/radarr/.config/Radarr/config.xml"; }; }; + environment.etc."alloy/radarr.alloy".text = + with config.services.prometheus.exporters.exportarr-radarr; '' + prometheus.scrape "radarr" { + targets = [ + { + __address__ = "${listenAddress}:${toString port}", + instance = "${config.networking.hostName}", + } + ] + forward_to = [prometheus.relabel.default.receiver] + } + ''; + systemd = { + services.alloy.reloadTriggers = [ config.environment.etc."alloy/radarr.alloy".source ]; + tmpfiles.rules = with config.services.radarr; [ "d /var/lib/radarr/root 0755 ${user} ${group} - -" ]; 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} - -" ]; |