Skip to content

Commit b029646

Browse files
committed
nixosTests/prometheus-exporters.exportarr-sonarr: use new env-vars
1 parent 4618d53 commit b029646

File tree

1 file changed

+4
-22
lines changed

1 file changed

+4
-22
lines changed

nixos/tests/prometheus-exporters.nix

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -364,28 +364,10 @@ let
364364
apiKeyFile = pkgs.writeText "dummy-api-key" apikey;
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+
environmentFiles = [(pkgs.writeText "sonarr-env" "SONARR__AUTH__APIKEY=${apikey}")];
370+
};
389371
};
390372
exporterTest = ''
391373
wait_for_unit("sonarr.service")

0 commit comments

Comments
 (0)