I’m trying to set up grafana with exportarr for sonarr. Exportarr requires an api key for sonarr/radarr and the nix service provides this with systemd LoadCredential. I have set this up with agenix to provide it as a secret. However, I keep getting the error regex: api-key must be a 20-32 character alphanumeric string
. When I read the secret file as the exportarr user I can read it just fine, but it seems like something is going wrong in the service itself(maybe the LoadCredential) part. I am providing the secret as such:
age.secrets.sonarr = {
file = ../../secrets/sonarrApiKey.age;
owner = "exportarr";
group = "exportarr";
mode = "770";
};
And setting up exportarr for sonarr as follows:
services.prometheus = {
enable = true;
package = pkgs.unstable.prometheus;
exporters = {
...
exportarr-sonarr = {
enable = true;
package = pkgs.unstable.exportarr;
user = "exportarr";
group = "exportarr";
apiKeyFile = "/run/agenix/sonarr";
};
};
};
I have tried making a plain text file with the secret in it and setting apiKeyFile
to this path, but this gave the exact same error.