From 97481268826f67b0168639d8c399ad93c0f4d55a Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Fri, 24 May 2024 07:48:48 +0100 Subject: [PATCH] In-line firefox search engine config --- programs/firefox/default.nix | 44 ++++++++++++++++++--- programs/firefox/search-engines/default.nix | 36 ----------------- 2 files changed, 38 insertions(+), 42 deletions(-) delete mode 100644 programs/firefox/search-engines/default.nix diff --git a/programs/firefox/default.nix b/programs/firefox/default.nix index edd25b8..20ba8b0 100644 --- a/programs/firefox/default.nix +++ b/programs/firefox/default.nix @@ -130,12 +130,6 @@ } ]; }; - search = { - default = "DuckDuckGo"; - force = true; - order = ["DuckDuckGo"]; - engines = import ./search-engines/default.nix pkgs; - }; bookmarks = [ { name = "toplevel"; @@ -143,6 +137,44 @@ bookmarks = import ./bookmarks/default.nix lib; } ]; + search = rec { + default = "DuckDuckGo"; + privateDefault = default; + force = true; + order = ["DuckDuckGo" "Atlas SearXNG"]; + engines = { + "Atlas SearXNG" = { + urls = [{template = "https://search.atlas.engineer/searxng/search?q={searchTerms}";}]; + definedAliases = ["@atlas"]; + }; + "NixOS Wiki" = { + urls = [{template = "https://wiki.nixos.org/index.php?search={searchTerms}";}]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = ["@nix" "@nixos" "@nixoswiki"]; + }; + "Arch Wiki" = { + urls = [{template = "https://wiki.archlinux.org/index.php?search={searchTerms}";}]; + definedAliases = ["@aw" "@arch" "@archwiki"]; + }; + "GitHub" = { + urls = [{template = "https://github.com/search?q={searchTerms}";}]; + definedAliases = ["@gh" "@git" "@github"]; + }; + "FlatHub" = { + url = [{template = "https://flathub.org/apps/search?q={searchTerms}";}]; + definedAliases = ["@flat" "@fthub" "@flathub"]; + }; + "NixOS Packages" = { + urls = [{template = "http://search.nixos.org/packages?channel=unstable&size=50&sort=relevance&type=packages&query={searchTerms}";}]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = ["@nixpkgs"]; + }; + "PyPI packages" = { + urls = [{template = "https://pypi.org/search/?q={searchTerms}";}]; + definedAliases = ["@pypi"]; + }; + }; + }; }; }; }; diff --git a/programs/firefox/search-engines/default.nix b/programs/firefox/search-engines/default.nix deleted file mode 100644 index 4de742a..0000000 --- a/programs/firefox/search-engines/default.nix +++ /dev/null @@ -1,36 +0,0 @@ -pkgs: { - "Atlas SearXNG" = { - urls = [{template = "https://search.atlas.engineer/searxng/search?q={searchTerms}";}]; - definedAliases = ["@as"]; - }; - "OpenStreetMap" = { - urls = [{template = "https://www.openstreetmap.org/search?query={searchTerms}";}]; - definedAliases = ["@osm" "@openstreetmap"]; - }; - "NixOS Wiki" = { - urls = [{template = "https://nixos.wiki/index.php?search={searchTerms}";}]; - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = ["@nix" "@nixos" "@nixoswiki"]; - }; - "Arch Wiki" = { - urls = [{template = "https://wiki.archlinux.org/index.php?search={searchTerms}";}]; - definedAliases = ["@aw" "@arch" "@archwiki"]; - }; - "GitHub" = { - urls = [{template = "https://github.com/search?q={searchTerms}";}]; - definedAliases = ["@gh" "@git" "@github"]; - }; - "FlatHub" = { - url = [{template = "https://flathub.org/apps/search?q={searchTerms}";}]; - definedAliases = ["@flat" "@fthub" "@flathub"]; - }; - "NixOS Packages" = { - urls = [{template = "http://search.nixos.org/packages?channel=unstable&size=50&sort=relevance&type=packages&query={searchTerms}";}]; - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = ["@nixpkgs"]; - }; - "PyPI packages" = { - urls = [{template = "https://pypi.org/search/?q={searchTerms}";}]; - definedAliases = ["@pypi"]; - }; -}