NixOS/modules/servers/radarr.nix

26 lines
570 B
Nix

{
lib,
config,
proxyReverseArr,
...
}:
let
cfg = config.my.servers.radarr;
setup = import ../setup.nix { inherit lib config; };
in
{
options.my.servers.radarr = setup.mkOptions "radarr" "movies" 7878;
config = {
networking.firewall.allowedTCPPorts = lib.mkIf (!cfg.isLocal) [ cfg.port ];
services = {
radarr = lib.mkIf cfg.enable {
enable = true;
group = "piracy";
};
nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (
setup.proxyReverseArr cfg.hostName cfg.port // { }
);
};
};
}