firefox: better custom google search engine

This commit is contained in:
Primrose 2025-05-30 14:36:09 +02:00
parent e66b0d54d0
commit 817576c3fb
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
2 changed files with 26 additions and 21 deletions

View file

@ -19,27 +19,29 @@ in {
programs.firefox = {
enable = true;
policies.SearchEngines = {
Default = "Google Customized";
Add = [
/*
searxng doesn't
- have good multilingual search support
- use google backend on my server for some reason
*/
{
Name = "searxng";
URLTemplate = "https://sxng.confusedcompiler.org/search?q={searchTerms}";
}
{
Name = "Google Customized";
URLTemplate =
"https://google.com/search?q={searchTerms}"
+ mkLrFlag ["lang_fr" "lang_en" "lang_zh-TW"]
+ mkGlFlag "fr"
+ mkHlFlag "fr";
}
];
policies = {
RequestedLocales = ["fr" "en-US" "zh-TW"];
SearchEngines = {
Default = "Google Customized";
Remove = ["Google"];
Add = [
(let
withFlags = x:
x
+ mkLrFlag ["lang_fr" "lang_en" "lang_zh-TW"]
+ mkGlFlag "fr"
+ mkHlFlag "fr";
in {
Name = "Google Customized";
Alias = "G";
IconURL = "https://google.com/favicon.ico";
Description = "Your data yum yum";
SuggestURLTemplate = withFlags "https://suggestqueries.google.com/complete/search?q={searchTerms}";
URLTemplate = withFlags "https://google.com/search?q={searchTerms}";
})
];
};
};
profiles = {

View file

@ -7,6 +7,9 @@ in {
# https://mozilla.github.io/policy-templates
policies = {
SearchEngines = {
Remove = ["Bing" "DuckDuckGo" "Qwant" "eBay"];
};
HardwareAcceleration = true;
DisableFirefoxScreenshots = false;
DisablePocket = true;