mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 06:39:14 +00:00
135 lines
3.6 KiB
Nix
135 lines
3.6 KiB
Nix
{
|
|
pkgs,
|
|
config,
|
|
lib,
|
|
...
|
|
}: let
|
|
inherit (pkgs) nur;
|
|
|
|
# reference: https://developers.google.com/custom-search/docs/xml_results?hl=zh-tw#advanced-search-query-parameters
|
|
mkLrFlag = languageRestrictions:
|
|
"&lr=" + lib.escapeURL (builtins.concatStringsSep "|" languageRestrictions);
|
|
|
|
mkGlFlag = preferredCountry:
|
|
"&gl=" + preferredCountry;
|
|
|
|
mkHlFlag = hostLanguage:
|
|
"&hl=" + hostLanguage;
|
|
in {
|
|
programs.firefox = {
|
|
enable = true;
|
|
|
|
policies = {
|
|
RequestedLocales = ["fr" "en-US" "zh-TW"];
|
|
|
|
SearchEngines = {
|
|
Default = "Google Customized";
|
|
Remove = ["Google"];
|
|
Add = let
|
|
withGoogleFlags = 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 = withGoogleFlags "https://suggestqueries.google.com/complete/search?q={searchTerms}";
|
|
URLTemplate = withGoogleFlags "https://google.com/search?q={searchTerms}";
|
|
}
|
|
{
|
|
Name = "YouTube";
|
|
Alias = "yt";
|
|
IconURL = "https://youtube.com/favicon.ico";
|
|
SuggestURLTemplate = withGoogleFlags "http://suggestqueries.google.com/complete/search?q={searchTerms}&ds=yt";
|
|
URLTemplate = withGoogleFlags "https://www.youtube.com/results?search_query={searchTerms}";
|
|
}
|
|
{
|
|
Name = "Codeberg";
|
|
Alias = "gco";
|
|
IconURL = "https://codeberg.org/favicon.ico";
|
|
Description = "Software development, but free!";
|
|
URLTemplate = "https://codeberg.org/explore/repos?q={searchTerms}";
|
|
}
|
|
];
|
|
};
|
|
};
|
|
|
|
profiles = {
|
|
default = {
|
|
userChrome = ''
|
|
/* Only works in Firefox if layout.css.has-selector.enabled is set to true in about:config . */
|
|
html#main-window body:has(#sidebar-box[sidebarcommand=treestyletab_piro_sakura_ne_jp-sidebar-action][checked=true]:not([hidden=true])) #TabsToolbar {
|
|
visibility: collapse !important;
|
|
}
|
|
|
|
/* monofont tweak */
|
|
#statuspanel-label {
|
|
font-family: monospace;
|
|
}
|
|
.urlbar-input-box {
|
|
font-family: monospace;
|
|
}
|
|
'';
|
|
settings = {
|
|
"layout.css.has-selector.enabled" = true;
|
|
};
|
|
extensions.packages = let
|
|
addons = nur.repos.rycee.firefox-addons;
|
|
in [
|
|
addons.sponsorblock
|
|
addons.return-youtube-dislikes
|
|
|
|
addons.shinigami-eyes
|
|
|
|
addons.consent-o-matic
|
|
|
|
addons.tree-style-tab
|
|
];
|
|
};
|
|
|
|
junk = {
|
|
id = 1;
|
|
inherit
|
|
(config.programs.firefox.profiles.default)
|
|
settings
|
|
userChrome
|
|
;
|
|
|
|
extensions.packages = let
|
|
addons = nur.repos.rycee.firefox-addons;
|
|
in [addons.multi-account-containers];
|
|
|
|
containers = {
|
|
raisin = {
|
|
color = "purple";
|
|
icon = "fruit";
|
|
id = 1;
|
|
};
|
|
pomme = {
|
|
color = "red";
|
|
icon = "fruit";
|
|
id = 2;
|
|
};
|
|
};
|
|
};
|
|
|
|
# Isolate it because it's proprietary
|
|
tampermonkey = {
|
|
id = 2;
|
|
inherit
|
|
(config.programs.firefox.profiles.default)
|
|
settings
|
|
userChrome
|
|
;
|
|
|
|
extensions.packages = let
|
|
addons = nur.repos.rycee.firefox-addons;
|
|
in [addons.tampermonkey];
|
|
};
|
|
};
|
|
};
|
|
}
|