From 284d27ecf6de7f7dce12d08ab46853a31649f40f Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Sun, 6 Oct 2024 22:20:39 +0200 Subject: [PATCH] home/programs/browsers: set custom search engines for firefox --- home/programs/browsers.nix | 49 +++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/home/programs/browsers.nix b/home/programs/browsers.nix index b25d9a6..aa89d3d 100644 --- a/home/programs/browsers.nix +++ b/home/programs/browsers.nix @@ -1,4 +1,51 @@ {pkgs, ...}: { programs.chromium.enable = true; - home.packages = [pkgs.floorp]; + programs.firefox = { + enable = true; + profiles = { + nezia = { + search = { + engines = { + "Nix Packages" = { + urls = [ + { + template = "https://search.nixos.org/packages"; + params = [ + { + name = "type"; + value = "packages"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = ["@np"]; + }; + "NixOS Wiki" = { + urls = [{template = "https://wiki.nixos.org/w/index.php?search={searchTerms}";}]; + iconUpdateURL = "https://wiki.nixos.org/favicon.ico"; + updateInterval = 24 * 60 * 60 * 1000; # every day + definedAliases = ["@nw"]; + }; + "Home Manager Option Search" = { + urls = [{template = "https://home-manager-options.extranix.com/?release=master&query={searchTerms}";}]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = ["@hm"]; + }; + "Arch Wiki" = { + urls = [{template = "https://wiki.archlinux.org/index.php?search={searchTerms}";}]; + icon = "https://archlinux.org/favicon.ico"; + definedAliases = ["@aw"]; + }; + "Google".metaData.alias = "@g"; # builtin engines only support specifying one additional alias + }; + }; + isDefault = true; + }; + }; + }; }