From a613280f7e96f83ccf6df88447e6a5ea6297e13a Mon Sep 17 00:00:00 2001 From: notohh Date: Tue, 10 Oct 2023 15:42:00 -0400 Subject: [PATCH] yuki: switch searxng to nix --- hosts/yuki/services/searxng.nix | 51 ++++++++++++++++++++++++++------- hosts/yuki/services/traefik.nix | 6 ---- 2 files changed, 40 insertions(+), 17 deletions(-) diff --git a/hosts/yuki/services/searxng.nix b/hosts/yuki/services/searxng.nix index c5ba505..ba115f6 100644 --- a/hosts/yuki/services/searxng.nix +++ b/hosts/yuki/services/searxng.nix @@ -1,14 +1,43 @@ -_: { - virtualisation.oci-containers.containers.searxng = { - image = "searxng/searxng:2023.6.10-5f11155c"; - volumes = [ - "/home/notoh/docker/searxng:/etc/searxng:rw" - ]; - environment = { - INSTANCE_NAME = "SearXNG"; +{ + pkgs, + config, + ... +}: { + sops.secrets.searxng-secret = {}; + networking.firewall.allowedTCPPorts = [8100]; + services.searx = { + package = pkgs.searxng; + enable = true; + environmentFile = config.sops.secrets.searxng-secret.path; + settings = { + general = { + debug = false; + instance_name = "SearXNG flake.sh"; + enable_metrics = false; + contact_url = "mailto:contact@notohh.dev"; + }; + ui = { + default_theme = "simple"; + theme_args = { + simple_style = "dark"; + }; + }; + search = { + autocomplete = "google"; + safe_search = 0; + default_lang = "en-US"; + }; + server = { + port = 8100; + bind_address = "0.0.0.0"; + secret_key = "@SEARXNG_SECRET@"; + base_url = "https://search.flake.sh/"; + public_instance = true; + infinite_scroll = true; + }; + redis = { + url = "redis://:searxng@100.94.214.100:6380"; + }; }; - ports = [ - "8100:8080" - ]; }; } diff --git a/hosts/yuki/services/traefik.nix b/hosts/yuki/services/traefik.nix index 0619fc0..b766ca5 100644 --- a/hosts/yuki/services/traefik.nix +++ b/hosts/yuki/services/traefik.nix @@ -15,11 +15,6 @@ _: { entrypoints = ["web"]; service = "homarr"; }; - searxng = { - rule = "Host(`searxng.internal.flake.sh`)"; - entryPoints = ["web"]; - service = "searxng"; - }; stash = { rule = "Host(`stash.internal.flake.sh`)"; entrypoints = ["web"]; @@ -45,7 +40,6 @@ _: { stash.loadBalancer.servers = [{url = "http://localhost:9999";}]; homarr.loadBalancer.servers = [{url = "http://localhost:7575";}]; dashdot.loadBalancer.servers = [{url = "http://localhost:4000";}]; - searxng.loadBalancer.servers = [{url = "http://localhost:8100";}]; jellyfin.loadBalancer.servers = [{url = "http://localhost:8096";}]; jellyseerr.loadBalancer.servers = [{url = "http://localhost:5055";}]; };