From d32729ee814a3916a2a1f20859feed6a8790b313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sun, 6 Oct 2024 02:06:44 +0200 Subject: [PATCH] nixos/tests/searx: cleanup --- nixos/tests/searx.nix | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/nixos/tests/searx.nix b/nixos/tests/searx.nix index 0008424f068b2e..4afc2851e8a86d 100644 --- a/nixos/tests/searx.nix +++ b/nixos/tests/searx.nix @@ -39,19 +39,16 @@ # fancy setup: run in uWSGI and use nginx as proxy nodes.fancy = - { config, ... }: + { config, lib, ... }: { services.searx = { enable = true; # searx refuses to run if unchanged settings.server.secret_key = "somesecret"; - runInUwsgi = true; + configureNginx = true; + domain = "localhost"; uwsgiConfig = { - # serve using the uwsgi protocol - socket = "/run/searx/uwsgi.sock"; - chmod-socket = "660"; - # use /searx as url "mountpoint" mount = "/searx=searx.webapp:application"; module = ""; @@ -59,19 +56,12 @@ }; }; - # use nginx as reverse proxy - services.nginx.enable = true; - services.nginx.virtualHosts.localhost = { - locations."/searx".extraConfig = '' - include ${pkgs.nginx}/conf/uwsgi_params; - uwsgi_pass unix:/run/searx/uwsgi.sock; - ''; - locations."/searx/static/".alias = "${config.services.searx.package}/share/static/"; + services.nginx.virtualHosts.${config.services.searx.domain} = { + locations = { + "/static/" = lib.mkForce null; + "/searx/static/".alias = "${config.services.searx.package}/share/static/"; + }; }; - - # allow nginx access to the searx socket - users.users.nginx.extraGroups = [ "searx" ]; - }; testScript = ''