make firefox search engine code a little prettier :>

This commit is contained in:
xunuwu 2025-02-10 23:30:12 +01:00
parent 9580973995
commit fb35ab4c18
Signed by: xun
SSH key fingerprint: SHA256:Uot/1WoAjWAeqLOHA5vYy4phhVydsH7jCPmBjaPZfgI

View file

@ -14,101 +14,52 @@
"DuckDuckGo" "DuckDuckGo"
]; ];
engines = { engines = let
mkUrl = x: lib.singleton {template = x;};
in {
"Home Manager" = { "Home Manager" = {
urls = singleton { urls = mkUrl "https://home-manager-options.extranix.com?release=master&query={searchTerms}";
template = "https://home-manager-options.extranix.com";
params = attrsToList {
query = "{searchTerms}";
release = "master";
};
};
iconUpdateURL = "https://home-manager-options.extranix.com/images/favicon.png"; iconUpdateURL = "https://home-manager-options.extranix.com/images/favicon.png";
definedAliases = ["@hm"]; definedAliases = ["@hm"];
}; };
"Nix Packages" = { "Nix Packages" = {
urls = singleton { urls = mkUrl "https://search.nixos.org/packages?channel=unstable&query={searchTerms}";
template = "https://search.nixos.org/packages";
params = attrsToList {
query = "{searchTerms}";
channel = "unstable";
};
};
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@np"]; definedAliases = ["@np"];
}; };
"NixOS Options" = { "NixOS Options" = {
urls = singleton { urls = mkUrl "https://search.nixos.org/options?channel=unstable&query={searchTerms}";
template = "https://search.nixos.org/options";
params = attrsToList {
query = "{searchTerms}";
channel = "unstable";
};
};
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@no"]; definedAliases = ["@no"];
}; };
"GitHub" = { "GitHub" = {
urls = singleton { urls = mkUrl "https://github.com/search?type=code&q={searchTerms}";
template = "https://github.com/search";
params = attrsToList {
q = "{searchTerms}";
type = "code";
};
};
iconUpdateURL = "https://github.githubassets.com/favicons/favicon-dark.svg"; iconUpdateURL = "https://github.githubassets.com/favicons/favicon-dark.svg";
definedAliases = ["@gh"]; definedAliases = ["@gh"];
}; };
"GitHub Repos" = { "GitHub Repos" = {
urls = singleton { urls = mkUrl "https://github.com/search?type=code&q={searchTerms}";
template = "https://github.com/search";
params = attrsToList {
q = "{searchTerms}";
type = "repositories";
};
};
iconUpdateURL = "https://github.githubassets.com/favicons/favicon-dark.svg"; iconUpdateURL = "https://github.githubassets.com/favicons/favicon-dark.svg";
definedAliases = ["@ghr"]; definedAliases = ["@ghr"];
}; };
"GitHub Nix" = { "GitHub Nix" = {
urls = singleton { urls = mkUrl "https://github.com/search?type=code&q=lang:nix NOT is:fork {searchTerms}";
template = "https://github.com/search";
params = attrsToList {
"q" = "lang:nix {searchTerms}";
"type" = "code";
};
};
iconUpdateURL = "https://github.githubassets.com/favicons/favicon-dark.svg"; iconUpdateURL = "https://github.githubassets.com/favicons/favicon-dark.svg";
definedAliases = ["@ghn"]; definedAliases = ["@ghn"];
}; };
"Brave" = { "Brave" = {
urls = singleton { urls = mkUrl "https://search.brave.com/search?q={searchTerms}";
template = "https://search.brave.com/search";
params = attrsToList {
"q" = "{searchTerms}";
};
};
iconUpdateURL = "https://brave.com/static-assets/images/brave-favicon.png"; iconUpdateURL = "https://brave.com/static-assets/images/brave-favicon.png";
definedAliases = ["@b"]; definedAliases = ["@b"];
}; };
"YouTube" = { "YouTube" = {
urls = singleton { urls = mkUrl "https://www.youtube.com/results?search_query={searchTerms}";
template = "https://www.youtube.com/results";
params = attrsToList {
"search_query" = "{searchTerms}";
};
};
iconUpdateURL = "https://www.youtube.com/favicon.ico"; iconUpdateURL = "https://www.youtube.com/favicon.ico";
definedAliases = ["@yt"]; definedAliases = ["@yt"];
}; };
"crates.io" = { "crates.io" = {
urls = singleton { urls = mkUrl "https://crates.io/search?q={searchTerms}";
template = "https://crates.io/search";
params = attrsToList {
"q" = "{searchTerms}";
};
};
iconUpdateURL = "https://crates.io/favicon.ico"; iconUpdateURL = "https://crates.io/favicon.ico";
definedAliases = ["@cr"]; definedAliases = ["@cr"];
}; };