feat(defaults/browsers): add to firefox

This commit is contained in:
Elec3137 2026-04-08 13:12:05 -07:00
commit ae7430884d
Signed by: electria
SSH key fingerprint: SHA256:8LlB3ucPbBHqozqkhsNbaV5oG3SlzzqUj8FZDL6IPQs

View file

@ -16,17 +16,27 @@ in
config = lib.mkIf cfg.enable {
programs.firefox = lib.mkDefault {
policies = {
ExtensionSettings = {
"uBlock0@raymondhill.net" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
installation_mode = "normal_installed";
};
};
ExtensionSettings =
let
# source: https://discourse.nixos.org/t/declare-firefox-extensions-and-settings/36265/17
extension = shortId: uuid: {
name = uuid;
value = {
install_url = "https://addons.mozilla.org/en-US/firefox/downloads/latest/${shortId}/latest.xpi";
installation_mode = "normal_installed";
};
};
in
builtins.listToAttrs [
(extension "ublock-origin" "uBlock0@raymondhill.net")
(extension "black21" "{9b84b6b4-07c4-4b4b-ba21-394d86f6e9ee}")
];
Preferences = {
"browser.newtabpage.activity-stream.feeds.wallpaperfeed".Value = false;
"browser.newtabpage.activity-stream.feeds.weatherfeed".Value = false;
# from https://discourse.nixos.org/t/declare-firefox-extensions-and-settings/36265
# source: https://discourse.nixos.org/t/declare-firefox-extensions-and-settings/36265
"browser.newtabpage.activity-stream.feeds.section.topstories".Value = false;
"browser.newtabpage.activity-stream.feeds.snippets".Value = false;
"browser.newtabpage.activity-stream.section.highlights.includePocket".Value = false;
@ -36,6 +46,30 @@ in
"browser.newtabpage.activity-stream.showSponsored".Value = false;
"browser.newtabpage.activity-stream.system.showSponsored".Value = false;
"browser.newtabpage.activity-stream.showSponsoredTopSites".Value = false;
"browser.newtabpage.activity-stream.showSearch".Value = false;
"browser.newtabpage.activity-stream.feeds.topsites".Value = false;
"browser.newtabpage.activity-stream.showWeather".Value = false;
};
SearchEngines = {
Add = [
# source: https://discourse.nixos.org/t/declare-firefox-extensions-and-settings/36265/33
{
Alias = "@np";
IconURL = "https://nixos.org/favicon.png";
Method = "GET";
Name = "NixOS Packages";
URLTemplate = "https://search.nixos.org/packages?from=0&size=200&sort=relevance&type=packages&query={searchTerms}";
}
{
Alias = "@no";
IconURL = "https://nixos.org/favicon.png";
Method = "GET";
Name = "NixOS Options";
URLTemplate = "https://search.nixos.org/options?from=0&size=200&sort=relevance&type=packages&query={searchTerms}";
}
];
};
};
};