diff options
| author | quentin@aristote.fr <quentin@aristote.fr> | 2026-10-12 10:38:20 +0200 |
|---|---|---|
| committer | quentin@aristote.fr <quentin@aristote.fr> | 2026-10-12 10:41:21 +0200 |
| commit | 4b5dd6a2895dde26c38498d0d899aaa12b009a69 (patch) | |
| tree | 70fca0365c8859d4c0fbd00725e69439ff708057 /config/services/web/searx/default.nix | |
| parent | 583bbed47c3b85e41bef50eeea4f833076e685b4 (diff) | |
| download | hermes-4b5dd6a2895dde26c38498d0d899aaa12b009a69.tar.gz hermes-4b5dd6a2895dde26c38498d0d899aaa12b009a69.tar.bz2 hermes-4b5dd6a2895dde26c38498d0d899aaa12b009a69.tar.xz | |
searx: filtron -> limiter
Diffstat (limited to 'config/services/web/searx/default.nix')
| -rw-r--r-- | config/services/web/searx/default.nix | 88 |
1 files changed, 69 insertions, 19 deletions
diff --git a/config/services/web/searx/default.nix b/config/services/web/searx/default.nix index 46afcd8..6681366 100644 --- a/config/services/web/searx/default.nix +++ b/config/services/web/searx/default.nix @@ -1,37 +1,87 @@ { config, lib, + pkgs, ... }: let - cfg = { - searx = config.services.searx; - filtron = config.services.filtron; - }; + cfg = config.services.searx; in { imports = [ - ./searx - ./filtron + ./engines.nix + ./limiter.nix ]; - services.nginx.virtualHosts.searx = lib.mkIf (cfg.searx.enable && cfg.filtron.enable) { - serverName = "searx.${config.networking.domain}"; - locations = { - "/" = { - proxyPass = "http://${cfg.filtron.listen.address}:${toString cfg.filtron.listen.port}"; - extraConfig = '' - proxy_set_header Connection $http_connection; - proxy_set_header X-Scheme $scheme; - # proxy_set_header X-Script-Name /; - ''; - }; - "/static/".alias = "${cfg.searx.package}/share/static/"; + services.nginx.virtualHosts."searx.aristote.fr" = lib.mkIf (cfg.enable && cfg.configureNginx) { + locations."/" = { + extraConfig = '' + proxy_set_header Host $host; + proxy_set_header Connection $http_connection; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Scheme $scheme; + # proxy_set_header X-Script-Name /; + ''; }; forceSSL = true; enableACME = true; }; - systemd.services.uwsgi.personal.monitor = true; + services.searx = { + enable = true; + package = pkgs.searxng; + + configureNginx = true; + domain = "searx.aristote.fr"; + + configureUwsgi = true; + uwsgiConfig = { + cache2 = "name=searxcache,items=2000,blocks=2000,blocksize=4096,bitmap=1"; + }; + + environmentFile = "/etc/searx/secrets"; + settings = { + use_default_settings = true; + general = { + debug = true; + contact_url = "mailto:quentin@${config.networking.domain}"; + enable_stats = false; + }; + search = { + autocomplete = "wikipedia"; + default_lang = "all"; + formats = [ + "html" + "json" + ]; + }; + server = { + secret_key = "@SECRET_KEY@"; + image_proxy = true; + http_protocol_version = "1.0"; + method = "GET"; + }; + ui = { + theme_args = { + oscar_style = "pointhi"; + }; + }; + enabled_plugins = [ + "Open Access DOI rewrite" + "Hash plugin" + "HTTPS rewrite" + "Self Informations" + "Search on category select" + "Tracker URL remover" + "Vim-like hotkeys" + ]; + }; + }; + + systemd.services = { + searx-init.personal.monitor = true; + uwsgi.personal.monitor = true; + }; } |
