From 526937eb3931e85a3e85648b64e188ea049e035d Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Wed, 11 Mar 2026 12:40:44 +0100 Subject: [PATCH] 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 =