2023-03-15 22:36:29 +01:00
|
|
|
# manages indexes
|
2023-11-07 22:00:00 +01:00
|
|
|
{ config, lib, ... }:
|
2023-03-15 22:36:29 +01:00
|
|
|
let
|
|
|
|
cfg = config.my.services.prowlarr;
|
2023-11-07 23:13:51 +01:00
|
|
|
inherit (config.networking) domain;
|
2023-03-15 22:36:29 +01:00
|
|
|
port = 9696;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.my.services.prowlarr = with lib; {
|
|
|
|
enable = mkEnableOption "Prowlarr for indexing";
|
2023-07-25 22:20:49 +02:00
|
|
|
|
|
|
|
apiKeyFile = lib.mkOption {
|
|
|
|
type = lib.types.path;
|
|
|
|
description = lib.mdDoc ''
|
|
|
|
File containing the api-key.
|
|
|
|
'';
|
|
|
|
};
|
2023-03-15 22:36:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
services.prowlarr = {
|
|
|
|
enable = true;
|
|
|
|
};
|
|
|
|
# # ugly fix for service not having a homedirectory
|
|
|
|
# users.users.prowlarr = {
|
|
|
|
# isSystemUser = true;
|
|
|
|
# home = "/var/lib/prowlarr";
|
|
|
|
# group = "prowlarr";
|
|
|
|
# uid = 61654;
|
|
|
|
# };
|
|
|
|
# users.groups.prowlarr = {
|
|
|
|
# gid = 61654;
|
|
|
|
# };
|
|
|
|
|
|
|
|
systemd.services.prowlarr = {
|
|
|
|
after = [ "network-online.target" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
my.services.nginx.virtualHosts = [
|
|
|
|
{
|
2023-04-02 17:51:02 +02:00
|
|
|
subdomain = "indexer";
|
2023-03-15 22:36:29 +01:00
|
|
|
inherit port;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2023-07-22 16:05:28 +02:00
|
|
|
my.services.exportarr.prowlarr = {
|
|
|
|
port = port + 1;
|
|
|
|
url = "http://127.0.0.1:${toString port}";
|
2023-11-07 23:13:51 +01:00
|
|
|
inherit (cfg) apiKeyFile;
|
2023-07-22 16:05:28 +02:00
|
|
|
};
|
|
|
|
|
2023-07-25 22:20:49 +02:00
|
|
|
services.prometheus.scrapeConfigs = [
|
|
|
|
{
|
|
|
|
job_name = "prowlarr";
|
|
|
|
static_configs = [{
|
|
|
|
targets = [ "127.0.0.1:${toString port + 1}" ];
|
|
|
|
labels = {
|
|
|
|
instance = config.networking.hostName;
|
|
|
|
};
|
|
|
|
}];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2023-03-15 22:36:29 +01:00
|
|
|
webapps.apps.prowlarr = {
|
|
|
|
dashboard = {
|
2023-04-02 17:50:15 +02:00
|
|
|
name = "Indexer";
|
2023-06-04 14:30:30 +02:00
|
|
|
category = "app";
|
2023-03-15 22:36:29 +01:00
|
|
|
icon = "sync-alt";
|
2023-11-12 20:39:44 +01:00
|
|
|
url = "https://indexer.${domain}";
|
2023-03-15 22:36:29 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|