switch to librewolf
this is partial: we probably want to persist ~/.librewolf so that we aren't prompted with the extension notify pages on every start (or maybe there's a better solution).
This commit is contained in:
@@ -143,22 +143,42 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# librewolf is able to set the default search engine by using mozilla policies.
|
|
||||||
# they do this by removing the "enterprise" gate on some features and building a patched Firefox.
|
|
||||||
# some of the settings below assume those patches have been applied to firefox.
|
|
||||||
# see: https://gitlab.com/librewolf-community/settings/-/blob/master/distribution/policies.json
|
|
||||||
firefox = lib.mkIf (sysconfig.colinsane.gui.enable) {
|
firefox = lib.mkIf (sysconfig.colinsane.gui.enable) {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
# librewolf is a forked firefox which patches firefox to allow more things
|
||||||
# https://discourse.nixos.org/t/infinite-recursion-with-wrapfirefox/11579
|
# (like default search engines) to be configurable at runtime.
|
||||||
package = pkgs.wrapFirefox pkgs.firefox-unwrapped {
|
# many of the settings below won't have effect without those patches.
|
||||||
|
# see: https://gitlab.com/librewolf-community/settings/-/blob/master/distribution/policies.json
|
||||||
|
package = pkgs.wrapFirefox pkgs.librewolf-unwrapped {
|
||||||
|
# inherit the default librewolf.cfg
|
||||||
|
# it can be further customized via ~/.librewolf/librewolf.overrides.cfg
|
||||||
|
inherit (pkgs.librewolf-unwrapped) extraPrefsFiles;
|
||||||
|
libName = "librewolf";
|
||||||
extraPolicies = {
|
extraPolicies = {
|
||||||
|
NoDefaultBookmarks = true;
|
||||||
|
SearchEngines = {
|
||||||
|
Default = "DuckDuckGo";
|
||||||
|
};
|
||||||
|
AppUpdateURL = "https://localhost";
|
||||||
DisableAppUpdate = true;
|
DisableAppUpdate = true;
|
||||||
DisablePocket = true;
|
OverrideFirstRunPage = "";
|
||||||
|
OverridePostUpdatePage = "";
|
||||||
|
DisableSystemAddonUpdate = true;
|
||||||
DisableFirefoxStudies = true;
|
DisableFirefoxStudies = true;
|
||||||
DisableTelemetry = true;
|
DisableTelemetry = true;
|
||||||
DisableFeedbackCommands = true;
|
DisableFeedbackCommands = true;
|
||||||
|
DisablePocket = true;
|
||||||
|
DisableSetDesktopBackground = false;
|
||||||
Extensions = {
|
Extensions = {
|
||||||
|
Install = [
|
||||||
|
"https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"
|
||||||
|
"https://addons.mozilla.org/firefox/downloads/latest/i-dont-care-about-cookies/latest.xpi"
|
||||||
|
"https://addons.mozilla.org/firefox/downloads/latest/sponsorblock/latest.xpi"
|
||||||
|
"https://addons.mozilla.org/firefox/downloads/latest/bypass-paywalls-clean/latest.xpi"
|
||||||
|
"https://addons.mozilla.org/firefox/downloads/latest/sidebery/latest.xpi"
|
||||||
|
"https://addons.mozilla.org/firefox/downloads/latest/metamask/latest.xpi"
|
||||||
|
];
|
||||||
|
# remove many default search providers
|
||||||
Uninstall = [
|
Uninstall = [
|
||||||
"google@search.mozilla.org"
|
"google@search.mozilla.org"
|
||||||
"bing@search.mozilla.org"
|
"bing@search.mozilla.org"
|
||||||
@@ -167,64 +187,42 @@ in
|
|||||||
"twitter@search.mozilla.org"
|
"twitter@search.mozilla.org"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
SearchEngines = {
|
# XXX doesn't seem to have any effect...
|
||||||
Default = "DuckDuckGo";
|
# docs: https://github.com/mozilla/policy-templates#homepage
|
||||||
Remove = [
|
# Homepage = {
|
||||||
"Google"
|
# HomepageURL = "https://uninsane.org/";
|
||||||
"Bing"
|
# StartPage = "homepage";
|
||||||
"Amazon.com"
|
# };
|
||||||
"eBay"
|
# NewTabPage = true;
|
||||||
"Twitter"
|
# docs: https://chromeenterprise.google/policies/?policy=ManagedBookmarks
|
||||||
];
|
# docs: https://github.com/mozilla/policy-templates#managedbookmarks
|
||||||
Add = [
|
ManagedBookmarks = [
|
||||||
{
|
{
|
||||||
Name = "DuckDuckGo Lite";
|
toplevel_name = "bookmarks";
|
||||||
Description = "Minimal, ad-free version of DuckDuckGo";
|
}
|
||||||
Alias = "";
|
{
|
||||||
Method = "POST";
|
name = "Pleroma";
|
||||||
URLTemplate = "https://duckduckgo.com/lite/?q={searchTerms}";
|
url = "https://fed.uninsane.org/";
|
||||||
PostData = "q={searchTerms}";
|
}
|
||||||
}
|
{
|
||||||
];
|
name = "Delightful Apps";
|
||||||
};
|
url = "https://delightful.club/";
|
||||||
};
|
}
|
||||||
|
{
|
||||||
extraPrefs = ''
|
name = "Linux Phone Apps";
|
||||||
lockPref("devtools.theme","dark");
|
url = "https://linuxphoneapps.org/mobile-compatibility/5/";
|
||||||
lockPref("browser.search.defaultenginename","DuckDuckGo");
|
}
|
||||||
lockPref("browser.search.selectedEngine","DuckDuckGo");
|
{
|
||||||
lockPref("browser.search.defaulturl","https://duckduckgo.com/?q=");
|
name = "Crowdsupply";
|
||||||
lockPref("browser.search.searchEnginesURL","https://duckduckgo.com/?q=");
|
url = "https://www.crowdsupply.com/";
|
||||||
lockPref("browser.search.selectedEngineInDialog","DuckDuckGo");
|
}
|
||||||
lockPref("browser.search.hiddenOneOffs","Google,eBay,Yahoo,Bing,Amazon.com,Twitter");
|
{
|
||||||
lockPref("browser.search.update",false);
|
name = "Mempool";
|
||||||
lockPref("browser.urlbar.update2.engineAliasRefresh",false);
|
url = "https://jochen-hoenicke.de/queue";
|
||||||
lockPref("browser.urlbar.update2.oneOffsRefresh",false);
|
}
|
||||||
'';
|
];
|
||||||
};
|
|
||||||
|
|
||||||
profiles.default = {
|
|
||||||
bookmarks = {
|
|
||||||
fed_uninsane.url = "https://fed.uninsane.org/";
|
|
||||||
delightful.url = "https://delightful.club/";
|
|
||||||
crowdsupply.url = "https://www.crowdsupply.com/";
|
|
||||||
linux_phone_apps.url = "https://linuxphoneapps.org/mobile-compatibility/5/";
|
|
||||||
mempool.url = "https://jochen-hoenicke.de/queue";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# NB: these must be manually enabled in the Firefox settings on first start
|
|
||||||
# extensions can be found here: https://gitlab.com/rycee/nur-expressions/-/blob/master/pkgs/firefox-addons/addons.json
|
|
||||||
extensions = let
|
|
||||||
addons = pkgs.nur.repos.rycee.firefox-addons;
|
|
||||||
in [
|
|
||||||
addons.bypass-paywalls-clean
|
|
||||||
addons.metamask
|
|
||||||
addons.i-dont-care-about-cookies
|
|
||||||
addons.sidebery
|
|
||||||
addons.sponsorblock
|
|
||||||
addons.ublock-origin
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# "command not found" will cause the command to be searched in nixpkgs
|
# "command not found" will cause the command to be searched in nixpkgs
|
||||||
|
Reference in New Issue
Block a user