Skip to content

Commit

Permalink
nixos/tests/searx: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSandro2000 committed Nov 18, 2024
1 parent 6d38f50 commit d32729e
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions nixos/tests/searx.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,39 +39,29 @@

# 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 = "";
manage-script-name = true;
};
};

# 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 = ''
Expand Down

0 comments on commit d32729e

Please sign in to comment.