nixos-infra/services/searxng/network.nix
Rustam Efimov 68b1aaf79c
Some checks failed
Nix CI / build (push) Has been cancelled
fix(services/mail): rollback to old version
2026-04-14 20:34:12 +03:00

25 lines
435 B
Nix

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