From 34d173ce85439b04e7ffb122c8d795f6c3a02788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 28 Feb 2024 15:33:07 -0800 Subject: [PATCH 1/3] searxng: set meta.mainProgram --- pkgs/by-name/se/searxng/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/se/searxng/package.nix b/pkgs/by-name/se/searxng/package.nix index c0d6cd63036d..6f541d8a3b38 100644 --- a/pkgs/by-name/se/searxng/package.nix +++ b/pkgs/by-name/se/searxng/package.nix @@ -73,6 +73,7 @@ python3.pkgs.toPythonModule (python3.pkgs.buildPythonApplication rec { homepage = "https://github.com/searxng/searxng"; description = "A fork of Searx, a privacy-respecting, hackable metasearch engine"; license = licenses.agpl3Plus; + mainProgram = "searxng-run"; maintainers = with maintainers; [ SuperSandro2000 _999eagle ]; }; }) From 3330e3c9c389ef5423ddae1eeff37d71b24f3efa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 28 Feb 2024 15:34:16 -0800 Subject: [PATCH 2/3] nixos/searx: use lib.getExe --- nixos/modules/services/networking/searx.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/networking/searx.nix b/nixos/modules/services/networking/searx.nix index 938d585e3179..5bbf875f0d57 100644 --- a/nixos/modules/services/networking/searx.nix +++ b/nixos/modules/services/networking/searx.nix @@ -213,7 +213,7 @@ in serviceConfig = { User = "searx"; Group = "searx"; - ExecStart = "${cfg.package}/bin/searx-run"; + ExecStart = lib.getExe cfg.package; } // optionalAttrs (cfg.environmentFile != null) { EnvironmentFile = builtins.toPath cfg.environmentFile; }; environment = { From 603c5af51927b04fede367b5edc03d7f3fea0d85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Wed, 28 Feb 2024 15:39:23 -0800 Subject: [PATCH 3/3] nixos/tests/searx: use configured package for static content Also use the simple theme because upstream dropped the oscar one: https://github.com/searxng/searxng/discussions/1167 --- nixos/tests/searx.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nixos/tests/searx.nix b/nixos/tests/searx.nix index 2f808cb65266..02a88f690db7 100644 --- a/nixos/tests/searx.nix +++ b/nixos/tests/searx.nix @@ -36,7 +36,7 @@ import ./make-test-python.nix ({ pkgs, ...} : }; # fancy setup: run in uWSGI and use nginx as proxy - nodes.fancy = { ... }: { + nodes.fancy = { config, ... }: { imports = [ ../modules/profiles/minimal.nix ]; services.searx = { @@ -65,7 +65,7 @@ import ./make-test-python.nix ({ pkgs, ...} : include ${pkgs.nginx}/conf/uwsgi_params; uwsgi_pass unix:/run/searx/uwsgi.sock; ''; - locations."/searx/static/".alias = "${pkgs.searx}/share/static/"; + locations."/searx/static/".alias = "${config.services.searx.package}/share/static/"; }; # allow nginx access to the searx socket @@ -108,7 +108,7 @@ import ./make-test-python.nix ({ pkgs, ...} : "${pkgs.curl}/bin/curl --fail http://localhost/searx >&2" ) fancy.succeed( - "${pkgs.curl}/bin/curl --fail http://localhost/searx/static/themes/oscar/js/bootstrap.min.js >&2" + "${pkgs.curl}/bin/curl --fail http://localhost/searx/static/themes/simple/js/leaflet.js >&2" ) ''; })