depot/cluster/services/search/host.nix

46 lines
1.2 KiB
Nix
Raw Permalink Normal View History

{ cluster, config, depot, lib, ... }:
2022-05-25 12:11:10 +03:00
let
2022-06-18 03:44:51 +03:00
inherit (config) links;
2022-05-25 12:11:10 +03:00
in
{
2022-06-18 03:44:51 +03:00
links.searxng.protocol = "http";
2022-05-25 12:11:10 +03:00
services.searx = {
enable = true;
runInUwsgi = true;
2023-02-24 16:16:15 +02:00
package = depot.packages.searxng;
environmentFile = cluster.config.services.search.secrets.default.path;
2022-05-25 12:11:10 +03:00
settings = {
server = {
secret_key = "@SEARXNG_SECRET@";
};
search.formats = [
"html"
"json"
];
engines = [
{ name = "bing"; disabled = true; }
{ name = "brave"; disabled = true; }
];
ui.theme_args.simple_style = "dark";
2024-04-30 04:09:17 +03:00
outgoing = {
using_tor_proxy = true;
proxies = rec {
http = [ config.links.torSocks.url ];
https = http;
};
};
2022-05-25 12:11:10 +03:00
};
uwsgiConfig = {
2022-06-18 03:44:51 +03:00
http = links.searxng.tuple;
2022-05-25 12:11:10 +03:00
cache2 = "name=searxcache,items=2000,blocks=2000,blocksize=65536,bitmap=1";
buffer-size = 65536;
2022-05-25 21:45:08 +03:00
disable-logging = true;
2022-05-25 12:11:10 +03:00
};
};
2023-08-31 01:55:45 +03:00
services.nginx.virtualHosts."search.${depot.lib.meta.domain}" = lib.recursiveUpdate (depot.lib.nginx.vhosts.proxy links.searxng.url) {
2022-05-25 21:45:08 +03:00
extraConfig = "access_log off;";
};
2024-04-30 04:09:17 +03:00
systemd.services.uwsgi.after = [ "tor.service" ];
2022-05-25 12:11:10 +03:00
}