From 30eb87be69a63a301bc4085aae279eef5dfad1f6 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Thu, 31 Oct 2024 19:49:48 +0300 Subject: [PATCH] Search: Add extra config. --- container/Search.nix | 89 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/container/Search.nix b/container/Search.nix index a48e0d9..f36bbcb 100644 --- a/container/Search.nix +++ b/container/Search.nix @@ -40,12 +40,101 @@ in services.searx = { enable = true; package = pkgs.searxng; + # REF: https://github.com/searxng/searxng/blob/master/searx/settings.yml settings = { + general = { + debug = false; + instance_name = "SearX"; + enable_metrics = false; + }; server = { bind_address = cfg.address; port = cfg.port; secret_key = "searxxx"; + limiter = false; + public_instance = false; + image_proxy = false; + method = "GET"; }; + search = { + safe_search = 0; + autocomplete = ""; + autocomplete_min = 4; + default_lang = "auto"; + }; + ui = { + infinite_scroll = false; + default_theme = "simple"; + center_alignment = false; + default_locale = ""; + simple_style = "dark"; + hotkeys = "vim"; + }; + outgoing = { + request_timeout = 3.0; + max_request_timeout = 10.0; + pool_connections = 100; + pool_maxsize = 20; + enable_http2 = true; + # proxies = { + # "all://" = with config.container.module; [ + # # "socks5:${frkn.address}:${frkn.port}" + # "socks5:${frkn.address}:1081" + # # "socks5:${frkn.address}:9150" + # ]; + # }; + # using_tor_proxy = true; + # extra_proxy_timeout = 10; + }; + # plugins = [ ]; + enabled_plugins = [ + "Basic Calculator" + "Tracker URL remover" + "Hostnames plugin" + ]; + hostnames = { + replace = with config.container.module; { + "(.*\.)?youtube\.com$" = yt.domain; + "(.*\.)?youtu\.be$" = yt.domain; + }; + remove = [ + "(.*\.)?dzen\.ru?$" + "(.*\.)?facebook.com$" + "(.*\.)?gosuslugi\.com?$" + "(.*\.)?quora\.com?$" + "(.*\.)?rutube\.ru?$" + "(.*\.)?vk\.com?$" + ]; + low_priority = [ + "(.*\.)?google(\..*)?$" + "(.*\.)?microsoft\.com?$" + ]; + high_priority = [ "(.*\.)?wikipedia.org$" ]; + }; + categories_as_tabs = { + general = { }; + images = { }; + videos = { }; + news = { }; + map = { }; + it = { }; + files = { }; + }; + engines = + let + mkEnable = name: { + inherit name; + disabled = false; + }; + mkDisable = name: { + inherit name; + disabled = true; + }; + in + [ + (mkEnable "bing") + (mkDisable "qwant") + ]; }; }; };