feat: add searxng service
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2025-01-15 22:14:49 -05:00
parent e7accbd7bd
commit 17886d1355
7 changed files with 93 additions and 1 deletions

View file

@ -60,6 +60,7 @@ in {
"Vaultwarden" = mkPublicReverseProxy "vault" "${nosIP}:8781" {};
"Hauk" = mkPublicReverseProxy "hauk" "${nosIP}:3003" {};
"Headscale" = mkPublicReverseProxy "headscale" "${clusterIP}:8085" {};
"SearXNG" = mkPublicReverseProxy "search" "${clusterIP}:8080" {};
"Jellyfin" = mkPublicReverseProxy "jelly" "${nosIP}:8096" {
subDirectories.jfa-go = {

View file

@ -5,6 +5,7 @@
./headscale
./nfs-client.nix
./pcsd.nix
./searxng
./unbound.nix
];
}

View file

@ -48,6 +48,12 @@ in {
group = "caddy-grp";
startAfter = ["headscale"];
};
"searx" = {
enable = true;
group = "caddy-grp";
startAfter = ["caddy"];
};
};
nodes = [

View file

@ -0,0 +1,73 @@
{
config,
lib,
pkgs,
...
}: let
inherit (lib) mapAttrsToList;
in {
services.searx = {
enable = true;
package = pkgs.searxng.overrideAttrs (o: {
postInstall = ''
${o.postInstall or ""}
# Replace logo
cp ${./logo.png} $out/${pkgs.python3.sitePackages}/searx/static/themes/simple/img/searxng.png
'';
});
environmentFile = config.sops.secrets.searxng.path;
settings = {
general = {
instance_name = "Search";
debug = false;
enable_metrics = false;
};
search = {
autocomplete = "google";
favicon_resolver = "google";
safe_search = 0;
default_lang = "en-CA";
};
ui = {
infinite_scroll = true;
query_in_title = true;
hotkeys = "vim";
};
server = {
port = 8080;
bind_address = config.services.pcsd.virtualIps.caddy-vip.ip;
secret_key = "@SEARXNG_SECRET@";
public_instance = false;
};
engines = mapAttrsToList (name: value: {inherit name;} // value) {
"duckduckgo".disabled = false;
"duckduckgo images".disabled = false;
"gitlab".disabled = false;
"qwant".disabled = false;
"reddit".disabled = false;
"wikipedia" = {
engine = "wikipedia";
shortcut = "w";
base_url = "https://wikipedia.org/";
};
"github" = {
engine = "github";
shortcut = "gh";
};
};
};
};
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

View file

@ -107,9 +107,20 @@ in {
};
search = {
default = "DuckDuckGo";
default = "SearXNG";
force = true;
engines = {
"SearXNG" = {
urls = [
{
template = "https://search.nelim.org/search?q={searchTerms}";
}
];
iconUpdateURL = "https://search.nelim.org/favicon.ico";
updateInterval = 24 * 60 * 60 * 1000; # every day
definedAliases = ["@s"];
};
"Nixpkgs" = {
urls = [
{