26 lines
449 B
Nix
26 lines
449 B
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.machine.searxng;
|
|
in
|
|
with lib;
|
|
mkIf enable {
|
|
networking.firewall = {
|
|
allowedTCPPorts = [ cfg.port ];
|
|
};
|
|
|
|
services.nginx.virtualHosts =
|
|
mkIf (cfg.domain != null) {
|
|
"${cfg.domain}" = {
|
|
forceSSL = true;
|
|
enableACME = true;
|
|
locations."/" = {
|
|
proxyPass = "http://[::1]:${toString cfg.port}";
|
|
proxyWebsockets = true;
|
|
};
|
|
};
|
|
};
|
|
}
|