27 lines
801 B
Nix
27 lines
801 B
Nix
{ lib, config, ... }:
|
|
let
|
|
cfg = config.my.servers.prowlarr;
|
|
setup = import ./setup.nix { inherit lib config; };
|
|
in
|
|
{
|
|
options.my.servers.prowlarr = setup.mkOptions "prowlarr" "indexer" 9696;
|
|
config = {
|
|
networking.firewall.allowedTCPPorts = lib.mkIf (!cfg.isLocal) [ cfg.port ];
|
|
users.users.prowlarr = lib.mkIf cfg.enable {
|
|
group = "piracy";
|
|
isSystemUser = true;
|
|
};
|
|
services = {
|
|
prowlarr.enable = cfg.enable;
|
|
nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (
|
|
setup.proxyReverseArr cfg.hostName cfg.port // { }
|
|
);
|
|
};
|
|
virtualisation.oci-containers.containers.flaresolverr = lib.mkIf cfg.enable {
|
|
autoStart = true;
|
|
image = "ghcr.io/flaresolverr/flaresolverr:latest";
|
|
ports = [ "8191:8191" ];
|
|
};
|
|
};
|
|
}
|