2022-05-25 21:45:08 +03:00
|
|
|
{ config, inputs, lib, pkgs, tools, ... }:
|
2022-05-25 12:11:10 +03:00
|
|
|
let
|
|
|
|
port = config.portsStr.searxng;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
reservePortsFor = [ "searxng" ];
|
|
|
|
|
|
|
|
age.secrets.searxng-secrets.file = ../../../../secrets/searxng-secrets.age;
|
|
|
|
services.searx = {
|
|
|
|
enable = true;
|
|
|
|
runInUwsgi = true;
|
|
|
|
package = inputs.self.packages.${pkgs.system}.searxng;
|
|
|
|
environmentFile = config.age.secrets.searxng-secrets.path;
|
|
|
|
settings = {
|
|
|
|
server = {
|
|
|
|
secret_key = "@SEARXNG_SECRET@";
|
|
|
|
};
|
2022-05-26 20:14:25 +03:00
|
|
|
engines = [
|
|
|
|
{ name = "bing"; disabled = true; }
|
|
|
|
{ name = "brave"; disabled = true; }
|
|
|
|
];
|
2022-05-26 21:16:24 +03:00
|
|
|
ui.theme_args.simple_style = "dark";
|
2022-05-26 19:12:01 +03:00
|
|
|
outgoing.proxies = rec {
|
|
|
|
http = [
|
|
|
|
"socks5://es1-wg.socks5.mullvad.net:1080"
|
|
|
|
"socks5://ch10-wg.socks5.mullvad.net:1080"
|
|
|
|
"socks5://rs4-wg.socks5.mullvad.net:1080"
|
|
|
|
"socks5://ro4-wg.socks5.mullvad.net:1080"
|
|
|
|
"socks5://ch13-wg.socks5.mullvad.net:1080"
|
|
|
|
"socks5://es2-wg.socks5.mullvad.net:1080"
|
|
|
|
"socks5://ro5-wg.socks5.mullvad.net:1080"
|
|
|
|
"socks5://rs3-wg.socks5.mullvad.net:1080"
|
|
|
|
"socks5://ch21-wg.socks5.mullvad.net:1080"
|
|
|
|
"socks5://es4-wg.socks5.mullvad.net:1080"
|
|
|
|
"socks5://ch2-wg.socks5.mullvad.net:1080"
|
|
|
|
"socks5://ro6-wg.socks5.mullvad.net:1080"
|
|
|
|
"socks5://es5-wg.socks5.mullvad.net:1080"
|
|
|
|
"socks5://ch16-wg.socks5.mullvad.net:1080"
|
|
|
|
"socks5://ch6-wg.socks5.mullvad.net:1080"
|
|
|
|
"socks5://es6-wg.socks5.mullvad.net:1080"
|
|
|
|
"socks5://ro7-wg.socks5.mullvad.net:1080"
|
|
|
|
"socks5://es7-wg.socks5.mullvad.net:1080"
|
|
|
|
];
|
|
|
|
https = http;
|
|
|
|
};
|
2022-05-25 12:11:10 +03:00
|
|
|
};
|
|
|
|
uwsgiConfig = {
|
|
|
|
http = "127.0.0.1:${port}";
|
|
|
|
cache2 = "name=searxcache,items=2000,blocks=2000,blocksize=65536,bitmap=1";
|
|
|
|
buffer-size = 65536;
|
|
|
|
env = ["SEARXNG_SETTINGS_PATH=/run/searx/settings.yml"];
|
2022-05-25 21:45:08 +03:00
|
|
|
disable-logging = true;
|
2022-05-25 12:11:10 +03:00
|
|
|
};
|
|
|
|
};
|
2022-05-25 21:45:08 +03:00
|
|
|
services.nginx.virtualHosts."search.${tools.meta.domain}" = lib.recursiveUpdate (tools.nginx.vhosts.proxy "http://127.0.0.1:${port}") {
|
|
|
|
extraConfig = "access_log off;";
|
|
|
|
};
|
2022-05-26 19:12:01 +03:00
|
|
|
systemd.services.uwsgi.after = [ "wireguard-wgmv-es7.service" "network-addresses-wgmv-es7.service" ];
|
2022-05-25 12:11:10 +03:00
|
|
|
}
|