home/programs/browsers: add extra search engines for firefox

This commit is contained in:
Anthony Rodriguez 2024-10-22 00:06:18 +02:00
parent 373ab1c398
commit 0ac23d83ea
Signed by: nezia
GPG key ID: EE3BE97C040A86CE

View file

@ -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")