services/searxng: add module
This commit is contained in:
72
services/searxng.nix
Normal file
72
services/searxng.nix
Normal file
@@ -0,0 +1,72 @@
|
||||
# Module: services/searxng
|
||||
# Enables a searxng server
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
pkgsUnstable,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.searxng;
|
||||
searxngPort = 8888;
|
||||
in
|
||||
{
|
||||
options.searxng = {
|
||||
enable = mkEnableOption "Enables searxng module";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.searxng = {
|
||||
enable = true;
|
||||
package = pkgsUnstable.searxng;
|
||||
|
||||
settings = {
|
||||
general = {
|
||||
debug = false;
|
||||
privacypolicyurl = false;
|
||||
instance_name = "ET's Search";
|
||||
donation_url = false;
|
||||
contact_url = false;
|
||||
# TODO set up sops here
|
||||
#enable_metrics = true;
|
||||
#open_metrics = ""
|
||||
};
|
||||
search = {
|
||||
safe_search = 0;
|
||||
};
|
||||
server = {
|
||||
port = searxngPort;
|
||||
bind_address = 127.0 .0 .1;
|
||||
base_url = "app-01.tail755c5.ts.net/search/";
|
||||
public_instance = false;
|
||||
method = "POST";
|
||||
};
|
||||
ui = {
|
||||
infinite_scroll = true;
|
||||
default_theme = "simple";
|
||||
results_on_new_tab = true;
|
||||
hotkeys = "vim";
|
||||
url_formatting = "pretty";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.traefik.dynamicConfigOptions = {
|
||||
http.routers.searxng = {
|
||||
entrypoints = [ "websecure" ];
|
||||
rule = "Host(`app-01.tail755c5.ts.net`) && PathPrefix(`/search`)";
|
||||
tls = true;
|
||||
tls.certresolver = "tailscale";
|
||||
service = "searxng";
|
||||
};
|
||||
http.services.searxng = {
|
||||
loadbalancer.servers.port = searxngPort;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@@ -11,7 +11,9 @@
|
||||
{
|
||||
imports = [
|
||||
./radicale.nix
|
||||
./searxng.nix
|
||||
];
|
||||
|
||||
radicale.enable = lib.mkDefault false;
|
||||
searxng.enable = lib.mkDefault false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user