masive rewriting and setup of server files
This commit is contained in:
@@ -2,18 +2,24 @@
|
||||
lib,
|
||||
config,
|
||||
proxyReverse,
|
||||
setup,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.my.servers.bazarr;
|
||||
in
|
||||
{
|
||||
options.my.servers.bazarr.enable = lib.mkEnableOption "enable";
|
||||
config = lib.mkIf config.my.servers.bazarr.enable {
|
||||
options.my.servers.bazarr = setup.mkOptions "bazarr" "subs" config.services.bazarr.listenPort;
|
||||
config = {
|
||||
networking.firewall.allowedTCPPorts = lib.mkIf (!cfg.isLocal) [ cfg.port ];
|
||||
services = {
|
||||
bazarr = {
|
||||
bazarr = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
group = "piracy";
|
||||
};
|
||||
nginx.virtualHosts."subs.${config.my.domain}" =
|
||||
proxyReverse config.services.bazarr.listenPort // { };
|
||||
nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (
|
||||
proxyReverse cfg.hostName cfg.port // { }
|
||||
);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user