Skip to content

Commit 203d5d9

Browse files
committed
nixos/tests/prometheus-exporters: update exportarr-sonarr test
1 parent 3e40ff7 commit 203d5d9

File tree

1 file changed

+6
-24
lines changed

1 file changed

+6
-24
lines changed

nixos/tests/prometheus-exporters.nix

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -356,36 +356,18 @@ let
356356
'';
357357
};
358358

359-
exportarr-sonarr = let apikey = "eccff6a992bc2e4b88e46d064b26bb4e"; in {
359+
exportarr-sonarr = let apiKeyFile = pkgs.writeText "dummy-api-key" "eccff6a992bc2e4b88e46d064b26bb4e"; in {
360360
nodeName = "exportarr_sonarr";
361361
exporterConfig = {
362362
enable = true;
363363
url = "http://127.0.0.1:8989";
364-
apiKeyFile = pkgs.writeText "dummy-api-key" apikey;
364+
inherit apiKeyFile;
365365
};
366366
metricProvider = {
367-
services.sonarr.enable = true;
368-
systemd.services.sonarr.serviceConfig.ExecStartPre =
369-
let
370-
sonarr_config = pkgs.writeText "config.xml" ''
371-
<Config>
372-
<LogLevel>info</LogLevel>
373-
<EnableSsl>False</EnableSsl>
374-
<Port>8989</Port>
375-
<SslPort>9898</SslPort>
376-
<UrlBase></UrlBase>
377-
<BindAddress>*</BindAddress>
378-
<ApiKey>${apikey}</ApiKey>
379-
<AuthenticationMethod>None</AuthenticationMethod>
380-
<UpdateMechanism>BuiltIn</UpdateMechanism>
381-
<Branch>main</Branch>
382-
<InstanceName>Sonarr</InstanceName>
383-
</Config>
384-
'';
385-
in
386-
[
387-
''${pkgs.coreutils}/bin/install -D -m 777 ${sonarr_config} -T /var/lib/sonarr/.config/NzbDrone/config.xml''
388-
];
367+
services.sonarr = {
368+
enable = true;
369+
inherit apiKeyFile;
370+
};
389371
};
390372
exporterTest = ''
391373
wait_for_unit("sonarr.service")

0 commit comments

Comments
 (0)