searxng/module.nix: fix nginx, cleanup

This commit is contained in:
Charlie Root 2025-04-06 22:34:58 +02:00
commit b3139f4e8d
Signed by: faukah
SSH key fingerprint: SHA256:Uj2AXqvtdCA4hn5Hq0ZonhIAyUqI1q4w2sMG3Z1TH7E

View file

@ -6,7 +6,7 @@
}: let }: let
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.strings) toString; inherit (builtins) toString;
cfg = config.modules.services.searxng; cfg = config.modules.services.searxng;
port = 4021; port = 4021;
in { in {
@ -15,9 +15,8 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
networking.firewall.allowedTCPPorts = [port]; networking.firewall.allowedTCPPorts = [port];
modules.system.services.nginx.enable = true;
services = { services = {
nginx.enable = true;
searx = { searx = {
enable = true; enable = true;
package = pkgs.searxng; package = pkgs.searxng;
@ -101,7 +100,7 @@ in {
]; ];
}; };
}; };
nginx.virtualhosts."search.copeberg.org" = { nginx.virtualHosts."search.copeberg.org" = {
locations."/".proxyPass = "http://127.0.0.1:${toString port}"; locations."/".proxyPass = "http://127.0.0.1:${toString port}";
extraConfig = '' extraConfig = ''
access_log /dev/null; access_log /dev/null;