nix-config/modules/services/indexers.nix
Bruno BELANYI 77cf3430ae modules: services: use new nginx wrapper
And when not possible, document why.

Note for the future: there is some repetition in some modules to
configure the correct value of the subdomain, which I happen to know
will line up correctly thanks to the nginx wrapper. A good way to
refactor this in the future would involve avoiding this repetition,
allowing use to query the correct domain in some way...
2021-08-26 15:54:13 +02:00

44 lines
920 B
Nix

# Torrent and usenet meta-indexers
{ config, lib, ... }:
let
cfg = config.my.services.indexers;
jackettPort = 9117;
nzbhydraPort = 5076;
in
{
options.my.services.indexers = with lib; {
jackett.enable = mkEnableOption "Jackett torrent meta-indexer";
nzbhydra.enable = mkEnableOption "NZBHydra2 torrent meta-indexer";
};
config = {
services.jackett = lib.mkIf cfg.jackett.enable {
enable = true;
};
# Jackett wants to eat *all* my RAM if left to its own devices
systemd.services.jackett = {
serviceConfig = {
MemoryHigh = "15%";
MemoryMax = "25%";
};
};
services.nzbhydra2 = lib.mkIf cfg.nzbhydra.enable {
enable = true;
};
my.services.nginx.virtualHosts = [
{
subdomain = "jackett";
port = jackettPort;
}
{
subdomain = "nzbhydra";
port = nzbhydraPort;
}
];
};
}