mirror of
https://github.com/Stunkymonkey/nixos.git
synced 2025-05-24 09:54:40 +02:00
service/arr: migrate to nixos exportarr
This commit is contained in:
parent
d76ab3a87b
commit
2449611bce
4 changed files with 92 additions and 73 deletions
|
@ -7,7 +7,7 @@ let
|
|||
in
|
||||
{
|
||||
options.my.services.radarr = with lib; {
|
||||
enable = mkEnableOption "Radarr for films management";
|
||||
enable = mkEnableOption "Radarr for film management";
|
||||
|
||||
apiKeyFile = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
|
@ -18,8 +18,27 @@ in
|
|||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.radarr = {
|
||||
enable = true;
|
||||
services = {
|
||||
radarr = {
|
||||
enable = true;
|
||||
};
|
||||
prometheus.exporters.exportarr-radarr = {
|
||||
inherit (config.services.prometheus) enable;
|
||||
port = port + 1;
|
||||
url = "http://127.0.0.1:${toString port}";
|
||||
inherit (cfg) apiKeyFile;
|
||||
};
|
||||
prometheus.scrapeConfigs = [
|
||||
{
|
||||
job_name = "radarr";
|
||||
static_configs = [{
|
||||
targets = [ "127.0.0.1:${toString port + 1}" ];
|
||||
labels = {
|
||||
instance = config.networking.hostName;
|
||||
};
|
||||
}];
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
systemd.services.radarr = {
|
||||
|
@ -33,24 +52,6 @@ in
|
|||
}
|
||||
];
|
||||
|
||||
my.services.exportarr.radarr = {
|
||||
port = port + 1;
|
||||
url = "http://127.0.0.1:${toString port}";
|
||||
inherit (cfg) apiKeyFile;
|
||||
};
|
||||
|
||||
services.prometheus.scrapeConfigs = [
|
||||
{
|
||||
job_name = "radarr";
|
||||
static_configs = [{
|
||||
targets = [ "127.0.0.1:${toString port + 1}" ];
|
||||
labels = {
|
||||
instance = config.networking.hostName;
|
||||
};
|
||||
}];
|
||||
}
|
||||
];
|
||||
|
||||
webapps.apps.radarr = {
|
||||
dashboard = {
|
||||
name = "Movies";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue