mirror of
https://codeberg.org/muon/home.git
synced 2025-12-06 08:07:45 +00:00
50 lines
1.4 KiB
Nix
50 lines
1.4 KiB
Nix
{ pkgs, lib, config, ... }:
|
|
let
|
|
inherit (lib) types mkOption mkEnableOption;
|
|
cfg = config.mods.server.search;
|
|
port = 8081;
|
|
in {
|
|
options.mods.server.search = {
|
|
enable = mkEnableOption {
|
|
default = false;
|
|
description = "enables search engine server";
|
|
};
|
|
};
|
|
|
|
config = {
|
|
# mods.server.nginx.ports.search = port;
|
|
services.nginx.virtualHosts."search.muon.host" = {
|
|
enableACME = true;
|
|
forceSSL = true;
|
|
locations."/" = {
|
|
proxyPass = "http://10.0.0.3:${toString port}";
|
|
proxyWebsockets = true; # needed if you need to use WebSocket
|
|
extraConfig =
|
|
# required when the server wants to use HTTP Authentication
|
|
"proxy_pass_header Authorization;";
|
|
};
|
|
};
|
|
services.searx = lib.mkIf cfg.enable {
|
|
enable = true;
|
|
|
|
# runInUwsgi = true;
|
|
# uwsgiConfig = {
|
|
# disable-logging = true;
|
|
# http = ":${toString port}";
|
|
# };
|
|
|
|
settings = {
|
|
server.port = 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";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|