get extraPrefs working for nix firefox

This commit is contained in:
Freya Murphy 2024-11-15 15:27:19 -05:00
parent 0bfd4cd84b
commit 6b3b723722
Signed by: freya
GPG key ID: 9FBC6FFD6D2DBF17
2 changed files with 49 additions and 15 deletions

View file

@ -60,11 +60,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1730651795,
"narHash": "sha256-XGYmN3WdyGU8FasWLPjL1Yvm9L9GJ0h62fMgCOPyvo0=",
"lastModified": 1731684989,
"narHash": "sha256-FQdoHR4vqYZlk2qp1jD3rtKufseLiPFr8rctGNY0d5Y=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "5012ef7926747f739c65bd2e1ceff96da30fb3b8",
"rev": "1c6112d535e8f51e40d8f68eb0565afb2944ebba",
"type": "github"
},
"original": {

View file

@ -8,11 +8,44 @@
Value = true;
Status = "locked";
};
nixGL = import ./nixGL.nix { inherit pkgs nixgl; };
in
{
programs.firefox = {
enable = true;
package = pkgs.firefox.override {
extraPrefs = ''
//
// Automatically click cookiebanners although uBlock Origin might block them
lockPref("cookiebanners.bannerClicking.enabled", true);
lockPref("cookiebanners.service.mode", 2);
lockPref("cookiebanners.service.mode.privateBrowsing", 2);
// DNT although PrivacyBadger from policy handles this
lockPref("privacy.donottrackheader.enabled", true);
lockPref("privacy.donottrackheader.value", 1);
// Fingerprinting
lockPref("privacy.fingerprintingProtection", true);
pref(
"privacy.fingerprintingProtection.overrides",
"+AllTargets,-KeyboardEvents,-SpeechSynthesis,-CSSPrefersColorScheme,-CSSPrefersReducedMotion,-NavigatorUserAgent,-JSDateTimeUTC,-HttpUserAgent",
);
lockPref("privacy.fingerprintingProtection.pbmode", true);
lockPref("privacy.resistFingerprinting", false);
lockPref("privacy.resistFingerprinting.block_mozAddonManage", true);
lockPref("privacy.resistFingerprinting.letterboxing", false);
clearPref("privacy.resistFingerprinting.pbmode");
// New sidebar
lockPref("sidebar.revamp", true);
lockPref("sidebar.verticalTabs", true);
lockPref("sidebar.visibility", "always-show");
lockPref("sidebar.main.tools", "");
//
'';
};
policies = {
EnableTrackingProtection = {
@ -81,7 +114,7 @@
# Start Page
Homepage = {
StartPage = "previous-session";
Loked = true;
Locked = true;
};
# Home Page
@ -186,6 +219,10 @@
Value = "firefox-compact-dark@mozilla.org";
Status = "locked";
};
"layout.css.prefers-color-scheme.content-override" = {
Value = 0;
Status = "locked";
};
# homepage
"browser.startup.homepage" = {
Value = " about:home";
@ -243,6 +280,13 @@
"browser.newtabpage.activity-stream.showSponsored" = lock-false;
"browser.newtabpage.activity-stream.system.showSponsored" = lock-false;
"browser.newtabpage.activity-stream.showSponsoredTopSites" = lock-false;
"browser.newtabpage.activity-stream.showWeather" = lock-false;
"browser.newtabpage.activity-stream.newtabWallpapers.enabled" = lock-false;
"browser.newtabpage.activity-stream.newtabWallpapers.v2.enabled" = lock-false;
"browser.newtabpage.activity-stream.default.sites" = {
Value = "";
Status = "locked";
};
# safebrowsing
"browser.safebrowsing.malware.enabled" = lock-true;
"browser.safebrowsing.phishing.enabled" = lock-true;
@ -256,16 +300,6 @@
};
"browser.tabs.warnOnClose" = lock-true;
"browser.tabs.firefox-view" = lock-false;
"sidebar.revamp" = {
Comment = "Preference not allowed for stability reasons.";
Status = "default";
Type = "boolean";
Value = true;
};
"sidebar.main.tools" = {
Value = "";
Status = "locked";
};
"browser.tabs.closeTabByDblclick" = lock-true;
"ui.key.menuAccessKeyFocuses" = lock-false;
# general settings