modularized firewall logic
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
name,
|
||||
subdomain,
|
||||
port,
|
||||
serviceConfig ? { },
|
||||
nginxConfig ? null,
|
||||
}:
|
||||
let
|
||||
cfg = config.my.servers.${name};
|
||||
setup = import ./setup.nix { inherit lib config; };
|
||||
in
|
||||
{
|
||||
options.my.servers.${name} = setup.mkOptions name subdomain port;
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services = serviceConfig // {
|
||||
nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (
|
||||
if nginxConfig != null then nginxConfig cfg else setup.proxyReverseFix cfg
|
||||
);
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user