feat: refactored reverse proxy to be a normally named module

This commit is contained in:
Leyla Becker 2025-10-24 12:45:17 -05:00
parent 466926b919
commit 4dd285c122
29 changed files with 352 additions and 426 deletions

View file

@ -4,18 +4,28 @@
...
}: {
options.services.searx = {
subdomain = lib.mkOption {
type = lib.types.str;
description = "subdomain of base domain that searx will be hosted at";
default = "searx";
reverseProxy = {
domain = lib.mkOption {
type = lib.types.str;
description = "domain that searx will be hosted at";
default = "searx.arpa";
};
extraDomains = lib.mkOption {
type = lib.types.listOf lib.types.str;
description = "extra domains that should be configured for searx";
default = [];
};
};
};
config = lib.mkIf (config.services.searx.enable && config.host.reverse_proxy.enable) {
host = {
reverse_proxy.subdomains.searx = {
subdomain = config.services.searx.subdomain;
target = "http://localhost:${toString config.services.searx.settings.server.port}";
config = lib.mkIf (config.services.searx.enable && config.services.reverseProxy.enable) {
services.reverseProxy.services.searx = {
target = "http://localhost:${toString config.services.searx.settings.server.port}";
domain = config.services.searx.reverseProxy.domain;
extraDomains = config.services.searx.reverseProxy.extraDomains;
settings = {
forwardHeaders.enable = true;
};
};
};