From aa675991525e9e906543553671f7935e3e2e70f5 Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Wed, 11 Mar 2026 01:43:52 +0100 Subject: [PATCH 1/8] searxng: Init module --- modules/nixos/web-services/searxng.nix | 44 ++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 modules/nixos/web-services/searxng.nix diff --git a/modules/nixos/web-services/searxng.nix b/modules/nixos/web-services/searxng.nix new file mode 100644 index 0000000..97ffcaf --- /dev/null +++ b/modules/nixos/web-services/searxng.nix @@ -0,0 +1,44 @@ +{ config, lib, ... }: +let + cfg = config.custom.web-services.searxng; +in +{ + options.custom.web-services.searxng = { + enable = lib.mkEnableOption ""; + domain = lib.mkOption { + type = lib.types.nonEmptyStr; + default = ""; + }; + port = lib.mkOption { + type = lib.types.port; + default = 27916; + }; + }; + + config = lib.mkIf cfg.enable { + services.searx = { + enable = true; + settings = { + server = { + port = cfg.port; + secret_key = "unnecessary"; + }; + ui.center_alignment = true; + plugins = { + "searx.plugins.calculator.SXNGPlugin".active = true; + "searx.plugins.infinite_scroll.SXNGPlugin".active = true; + "searx.plugins.self_info.SXNGPlugin".active = true; + }; + }; + }; + + custom = { + services.caddy.virtualHosts.${cfg.domain}.port = cfg.port; + + meta.sites.${cfg.domain} = { + title = "SearXNG"; + icon = "sh:searxng"; + }; + }; + }; +} From a94e7e88985a198ebb3d49475a6e627b5c7c51fb Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Wed, 11 Mar 2026 01:44:08 +0100 Subject: [PATCH 2/8] srv-core: Enable searxng --- hosts/srv-core/configuration.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hosts/srv-core/configuration.nix b/hosts/srv-core/configuration.nix index 1f34570..5bdf6fe 100644 --- a/hosts/srv-core/configuration.nix +++ b/hosts/srv-core/configuration.nix @@ -71,6 +71,11 @@ enable = true; domain = "home.${config.custom.networking.overlay.domain}"; }; + + searxng = { + enable = true; + domain = "search.${config.custom.networking.overlay.domain}"; + }; }; }; } From 9fcbb238beb8a4d0df22e5ad54559059a74ab812 Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Wed, 11 Mar 2026 12:06:43 +0100 Subject: [PATCH 3/8] searxng: Enable autocompletion and favicons --- modules/nixos/web-services/searxng.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/nixos/web-services/searxng.nix b/modules/nixos/web-services/searxng.nix index 97ffcaf..ee42077 100644 --- a/modules/nixos/web-services/searxng.nix +++ b/modules/nixos/web-services/searxng.nix @@ -29,6 +29,10 @@ in "searx.plugins.infinite_scroll.SXNGPlugin".active = true; "searx.plugins.self_info.SXNGPlugin".active = true; }; + search = { + autocomplete = "duckduckgo"; + favicon_resolver = "duckduckgo"; + }; }; }; From b132276ca8d0e8036ac24297e527441598239cd7 Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Wed, 11 Mar 2026 12:12:44 +0100 Subject: [PATCH 4/8] searxng: Fix syntax --- modules/nixos/web-services/searxng.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nixos/web-services/searxng.nix b/modules/nixos/web-services/searxng.nix index ee42077..102224e 100644 --- a/modules/nixos/web-services/searxng.nix +++ b/modules/nixos/web-services/searxng.nix @@ -20,7 +20,7 @@ in enable = true; settings = { server = { - port = cfg.port; + inherit (cfg) port; secret_key = "unnecessary"; }; ui.center_alignment = true; From f9398c9d87acaf95db13de8156cf0eb449bf753c Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Wed, 11 Mar 2026 12:18:16 +0100 Subject: [PATCH 5/8] ci: Also notify when `await-deploy` got skipped --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c17f32..2c44b1c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -158,7 +158,7 @@ jobs: -d "$body" \ https://ntfy.sh/splitleaf - name: Notify failure - if: needs.await-deploy.result == 'failure' + if: needs.await-deploy.result == 'failure' || needs.await-deploy.result == 'skipped' env: SHA: ${{ github.sha }} COMMIT_MSG: ${{ github.event.head_commit.message }} From fafd352b530e1301f2dc2f20fe5019e5bceba495 Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Wed, 11 Mar 2026 12:22:50 +0100 Subject: [PATCH 6/8] searxng: Exclude `nixos.wiki` from search results --- modules/nixos/web-services/searxng.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/nixos/web-services/searxng.nix b/modules/nixos/web-services/searxng.nix index 102224e..b0ee186 100644 --- a/modules/nixos/web-services/searxng.nix +++ b/modules/nixos/web-services/searxng.nix @@ -33,6 +33,7 @@ in autocomplete = "duckduckgo"; favicon_resolver = "duckduckgo"; }; + hostnames.remove = [ ''(.*\.)?nixos.wiki'' ]; }; }; From 526937eb3931e85a3e85648b64e188ea049e035d Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Wed, 11 Mar 2026 12:40:44 +0100 Subject: [PATCH 7/8] firefox: Set default search engine to self hosted searxng --- modules/home/programs/firefox.nix | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/modules/home/programs/firefox.nix b/modules/home/programs/firefox.nix index 5097bfe..a342511 100644 --- a/modules/home/programs/firefox.nix +++ b/modules/home/programs/firefox.nix @@ -40,6 +40,16 @@ in |> lib.map (glance: glance.domain) |> lib.head; }; + searchEngine = lib.mkOption { + type = lib.types.nonEmptyStr; + default = + allHosts + |> lib.attrValues + |> lib.map (host: host.config.custom.web-services.searxng) + |> lib.filter (searxng: searxng.enable) + |> lib.map (searxng: searxng.domain) + |> lib.head; + }; extensions = lib.mkOption { type = lib.types.attrsOf ( lib.types.submodule ( @@ -115,6 +125,16 @@ in }; extraConfig = lib.readFile "${inputs.betterfox}/user.js"; + + search = { + force = true; + default = "searxng"; + privateDefault = "searxng"; + engines.searxng = { + name = "searxng"; + urls = lib.singleton { template = "https://${cfg.searchEngine}/search?q={searchTerms}"; }; + }; + }; }; policies.ExtensionSettings = From 31e26cfe37982634a819a08eb7444c02a7ff7723 Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Wed, 11 Mar 2026 12:42:21 +0100 Subject: [PATCH 8/8] glance Set self hosted searxng as the default for the search widget --- modules/nixos/web-services/glance.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nixos/web-services/glance.nix b/modules/nixos/web-services/glance.nix index a3f2e13..0893c06 100644 --- a/modules/nixos/web-services/glance.nix +++ b/modules/nixos/web-services/glance.nix @@ -87,7 +87,7 @@ in widgets = lib.singleton { type = "search"; - search-engine = "google"; + search-engine = "https://search.splitleaf.de/search?q={QUERY}"; autofocus = true; } ++ applicationSites