Add searx

This commit is contained in:
muon 2024-11-29 16:08:28 +00:00
parent f32b18439d
commit e0341a84d9
3 changed files with 91 additions and 0 deletions

View file

@ -0,0 +1,48 @@
{ pkgs, lib, config, ... }:
let
inherit (lib) types mkOption mkEnableOption;
cfg = config.mods.server.search;
in {
options.mods.server.search = {
enable = mkEnableOption {
default = false;
description = "enables search engine server";
};
port = mkOption {
type = types.port;
default = 8081;
};
nginx = mkOption {
type = types.nullOr types.str;
default = "search";
};
};
config = {
services.searx = lib.mkIf cfg.enable {
enable = true;
runInUwsgi = true;
uwsgiConfig = {
disable-logging = true;
http = ":${toString cfg.port}";
};
settings = {
server.port = cfg.port;
server.bind_address = "0.0.0.0";
server.secret_key = "temporary-before-sops";
enabled_plugins = [ "Hostnames plugin" "Tracker URL remover" ];
hostnames.remove = [ "(.*.)?facebook.com$" ];
hostnames.replace = {
"(.*.)?reddit.com$" = "redlib.northboot.xyz";
"(.*.)?youtube.com$" = "invidious.example.com";
};
};
};
};
}