2023-03-15 22:35:46 +01:00
|
|
|
# manages and downloads films
|
2023-11-07 22:00:00 +01:00
|
|
|
{ config, lib, ... }:
|
2023-03-15 22:35:46 +01:00
|
|
|
let
|
|
|
|
cfg = config.my.services.radarr;
|
2023-11-07 23:13:51 +01:00
|
|
|
inherit (config.networking) domain;
|
2025-02-25 23:53:44 +01:00
|
|
|
# in 25.05 this might be configurable
|
2023-03-15 22:35:46 +01:00
|
|
|
port = 7878;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.my.services.radarr = with lib; {
|
2023-11-30 23:38:42 +01:00
|
|
|
enable = mkEnableOption "Radarr for film management";
|
2023-07-25 22:20:49 +02:00
|
|
|
|
|
|
|
apiKeyFile = lib.mkOption {
|
|
|
|
type = lib.types.path;
|
2024-12-30 12:01:57 +01:00
|
|
|
description = ''
|
2023-07-25 22:20:49 +02:00
|
|
|
File containing the api-key.
|
|
|
|
'';
|
|
|
|
};
|
2023-03-15 22:35:46 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
2023-11-30 23:38:42 +01:00
|
|
|
services = {
|
|
|
|
radarr = {
|
|
|
|
enable = true;
|
|
|
|
};
|
|
|
|
prometheus.exporters.exportarr-radarr = {
|
|
|
|
inherit (config.services.prometheus) enable;
|
|
|
|
port = port + 1;
|
2024-12-27 20:30:21 +01:00
|
|
|
url = "http://localhost:${toString port}";
|
2023-11-30 23:38:42 +01:00
|
|
|
inherit (cfg) apiKeyFile;
|
|
|
|
};
|
|
|
|
prometheus.scrapeConfigs = [
|
|
|
|
{
|
|
|
|
job_name = "radarr";
|
2024-07-28 21:08:02 +02:00
|
|
|
static_configs = [
|
|
|
|
{
|
2024-12-27 20:30:21 +01:00
|
|
|
targets = [ "localhost:${toString port + 1}" ];
|
2024-07-28 21:08:02 +02:00
|
|
|
labels = {
|
|
|
|
instance = config.networking.hostName;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
2023-11-30 23:38:42 +01:00
|
|
|
}
|
|
|
|
];
|
2023-03-15 22:35:46 +01:00
|
|
|
};
|
|
|
|
|
2025-01-26 00:34:16 +01:00
|
|
|
my.services.webserver.virtualHosts = [
|
2023-03-15 22:35:46 +01:00
|
|
|
{
|
|
|
|
subdomain = "movies";
|
|
|
|
inherit port;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
webapps.apps.radarr = {
|
|
|
|
dashboard = {
|
2023-04-02 17:50:15 +02:00
|
|
|
name = "Movies";
|
2023-04-02 17:43:28 +02:00
|
|
|
category = "media";
|
2023-03-15 22:35:46 +01:00
|
|
|
icon = "film";
|
2023-11-12 20:39:44 +01:00
|
|
|
url = "https://movies.${domain}";
|
2024-02-18 20:13:09 +01:00
|
|
|
method = "get";
|
2023-03-15 22:35:46 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|