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
|
@ -8,12 +8,38 @@ in
|
||||||
{
|
{
|
||||||
options.my.services.bazarr = with lib; {
|
options.my.services.bazarr = with lib; {
|
||||||
enable = mkEnableOption "Bazarr for subtitle management";
|
enable = mkEnableOption "Bazarr for subtitle management";
|
||||||
|
|
||||||
|
apiKeyFile = lib.mkOption {
|
||||||
|
type = lib.types.path;
|
||||||
|
description = lib.mdDoc ''
|
||||||
|
File containing the api-key.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
services.bazarr = {
|
services = {
|
||||||
|
bazarr = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
prometheus.exporters.exportarr-bazarr = {
|
||||||
|
inherit (config.services.prometheus) enable;
|
||||||
|
port = port + 1;
|
||||||
|
url = "http://127.0.0.1:${toString port}";
|
||||||
|
inherit (cfg) apiKeyFile;
|
||||||
|
};
|
||||||
|
prometheus.scrapeConfigs = [
|
||||||
|
{
|
||||||
|
job_name = "bazarr";
|
||||||
|
static_configs = [{
|
||||||
|
targets = [ "127.0.0.1:${toString port + 1}" ];
|
||||||
|
labels = {
|
||||||
|
instance = config.networking.hostName;
|
||||||
|
};
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
systemd.services.bazarr = {
|
systemd.services.bazarr = {
|
||||||
after = [ "network-online.target" ];
|
after = [ "network-online.target" ];
|
||||||
|
|
|
@ -18,19 +18,28 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
services.prowlarr = {
|
services = {
|
||||||
|
prowlarr = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
# # ugly fix for service not having a homedirectory
|
prometheus.exporters.exportarr-prowlarr = {
|
||||||
# users.users.prowlarr = {
|
inherit (config.services.prometheus) enable;
|
||||||
# isSystemUser = true;
|
port = port + 1;
|
||||||
# home = "/var/lib/prowlarr";
|
url = "http://127.0.0.1:${toString port}";
|
||||||
# group = "prowlarr";
|
inherit (cfg) apiKeyFile;
|
||||||
# uid = 61654;
|
};
|
||||||
# };
|
prometheus.scrapeConfigs = [
|
||||||
# users.groups.prowlarr = {
|
{
|
||||||
# gid = 61654;
|
job_name = "prowlarr";
|
||||||
# };
|
static_configs = [{
|
||||||
|
targets = [ "127.0.0.1:${toString port + 1}" ];
|
||||||
|
labels = {
|
||||||
|
instance = config.networking.hostName;
|
||||||
|
};
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
systemd.services.prowlarr = {
|
systemd.services.prowlarr = {
|
||||||
after = [ "network-online.target" ];
|
after = [ "network-online.target" ];
|
||||||
|
@ -43,24 +52,6 @@ in
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
my.services.exportarr.prowlarr = {
|
|
||||||
port = port + 1;
|
|
||||||
url = "http://127.0.0.1:${toString port}";
|
|
||||||
inherit (cfg) apiKeyFile;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.prometheus.scrapeConfigs = [
|
|
||||||
{
|
|
||||||
job_name = "prowlarr";
|
|
||||||
static_configs = [{
|
|
||||||
targets = [ "127.0.0.1:${toString port + 1}" ];
|
|
||||||
labels = {
|
|
||||||
instance = config.networking.hostName;
|
|
||||||
};
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
webapps.apps.prowlarr = {
|
webapps.apps.prowlarr = {
|
||||||
dashboard = {
|
dashboard = {
|
||||||
name = "Indexer";
|
name = "Indexer";
|
||||||
|
|
|
@ -7,7 +7,7 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.my.services.radarr = with lib; {
|
options.my.services.radarr = with lib; {
|
||||||
enable = mkEnableOption "Radarr for films management";
|
enable = mkEnableOption "Radarr for film management";
|
||||||
|
|
||||||
apiKeyFile = lib.mkOption {
|
apiKeyFile = lib.mkOption {
|
||||||
type = lib.types.path;
|
type = lib.types.path;
|
||||||
|
@ -18,9 +18,28 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
services.radarr = {
|
services = {
|
||||||
|
radarr = {
|
||||||
enable = true;
|
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 = {
|
systemd.services.radarr = {
|
||||||
after = [ "network-online.target" ];
|
after = [ "network-online.target" ];
|
||||||
|
@ -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 = {
|
webapps.apps.radarr = {
|
||||||
dashboard = {
|
dashboard = {
|
||||||
name = "Movies";
|
name = "Movies";
|
||||||
|
|
|
@ -18,9 +18,28 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
services.sonarr = {
|
services = {
|
||||||
|
sonarr = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
prometheus.exporters.exportarr-sonarr = {
|
||||||
|
inherit (config.services.prometheus) enable;
|
||||||
|
port = port + 1;
|
||||||
|
url = "http://127.0.0.1:${toString port}";
|
||||||
|
inherit (cfg) apiKeyFile;
|
||||||
|
};
|
||||||
|
prometheus.scrapeConfigs = [
|
||||||
|
{
|
||||||
|
job_name = "sonarr";
|
||||||
|
static_configs = [{
|
||||||
|
targets = [ "127.0.0.1:${toString port + 1}" ];
|
||||||
|
labels = {
|
||||||
|
instance = config.networking.hostName;
|
||||||
|
};
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
systemd.services.sonarr = {
|
systemd.services.sonarr = {
|
||||||
after = [ "network-online.target" ];
|
after = [ "network-online.target" ];
|
||||||
|
@ -33,24 +52,6 @@ in
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
my.services.exportarr.sonarr = {
|
|
||||||
port = port + 1;
|
|
||||||
url = "http://127.0.0.1:${toString port}";
|
|
||||||
inherit (cfg) apiKeyFile;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.prometheus.scrapeConfigs = [
|
|
||||||
{
|
|
||||||
job_name = "sonarr";
|
|
||||||
static_configs = [{
|
|
||||||
targets = [ "127.0.0.1:${toString port + 1}" ];
|
|
||||||
labels = {
|
|
||||||
instance = config.networking.hostName;
|
|
||||||
};
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
webapps.apps.sonarr = {
|
webapps.apps.sonarr = {
|
||||||
dashboard = {
|
dashboard = {
|
||||||
name = "Series";
|
name = "Series";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue