mirror of
https://codeberg.org/muon/home.git
synced 2025-12-06 08:07:45 +00:00
Add searx
This commit is contained in:
parent
f32b18439d
commit
e0341a84d9
3 changed files with 91 additions and 0 deletions
48
modules/nixos/server/search.nix
Normal file
48
modules/nixos/server/search.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue