From 0ac23d83ea34907faab6c10a256044b00656cc9a Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Tue, 22 Oct 2024 00:06:18 +0200 Subject: [PATCH] home/programs/browsers: add extra search engines for firefox --- home/programs/browsers/firefox.nix | 87 +++++++++++++++--------------- 1 file changed, 45 insertions(+), 42 deletions(-) diff --git a/home/programs/browsers/firefox.nix b/home/programs/browsers/firefox.nix index 769a3ab..7e26a2e 100644 --- a/home/programs/browsers/firefox.nix +++ b/home/programs/browsers/firefox.nix @@ -1,9 +1,4 @@ -{ - lib, - inputs, - pkgs, - ... -}: let +{pkgs, ...}: let betterfox = pkgs.fetchFromGitHub { owner = "yokoffing"; repo = "betterfox"; @@ -80,41 +75,6 @@ in { search = { default = "SearxNG"; 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 Options" = { - 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"]; - }; "SearxNG" = { urls = [ { @@ -139,13 +99,56 @@ in { "type" = "application/x-suggestions+json"; } ]; - definedAliases = ["@sx"]; + iconUpdateURL = "https://searx.tiekoetter.com/favicon.ico"; + updateInterval = 24 * 60 * 60 * 1000; + definedAliases = ["@s"]; + }; + "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; + definedAliases = ["@nw"]; + }; + "NixOS Options" = { + urls = [{template = "https://search.nixos.org/options?channel=unstable&type=packages&query={searchTerms}";}]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = ["@no"]; + }; + "Noogle" = { + urls = [{template = "https://noogle.dev/q?term={searchTerms}";}]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = ["@ng"]; + }; + "Home Manager" = { + 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"]; }; "Google".metaData.alias = "@g"; # builtin engines only support specifying one additional alias }; }; # https://github.com/oddlama/nix-config/blob/main/users/myuser/graphical/firefox.nix#L53-L57 extraConfig = builtins.concatStringsSep "\n" [ + (builtins.readFile "${betterfox}/user.js") (builtins.readFile "${betterfox}/Securefox.js") (builtins.readFile "${betterfox}/Fastfox.js") (builtins.readFile "${betterfox}/Peskyfox.js")