fix webgl firefox without breaking policies

This commit is contained in:
Murphy 2024-11-24 00:17:31 -05:00
parent e625ae6617
commit 0b8ecc3096
Signed by: freya
GPG key ID: 9FBC6FFD6D2DBF17

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: { pkgs, nixgl, ... }:
let let
lock-false = { lock-false = {
Value = false; Value = false;
@ -8,11 +8,8 @@
Value = true; Value = true;
Status = "locked"; Status = "locked";
}; };
in nixGL = "${nixgl.packages.${pkgs.system}.nixGLIntel}/bin/nixGLIntel";
{ my-firefox = (pkgs.firefox.override {
programs.firefox = {
enable = true;
package = pkgs.firefox.override {
extraPrefs = '' extraPrefs = ''
// //
@ -25,18 +22,6 @@
lockPref("privacy.donottrackheader.enabled", true); lockPref("privacy.donottrackheader.enabled", true);
lockPref("privacy.donottrackheader.value", 1); 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 // New sidebar
lockPref("sidebar.revamp", true); lockPref("sidebar.revamp", true);
lockPref("sidebar.verticalTabs", true); lockPref("sidebar.verticalTabs", true);
@ -45,7 +30,16 @@
// //
''; '';
}; }).overrideAttrs (old: {
buildCommand = old.buildCommand + ''
sed -i "s#firefox-wrapped\"#firefox-wrapped\" \"${nixGL}\"#1" "$out/bin/firefox"
'';
});
in
{
programs.firefox = {
enable = true;
package = my-firefox;
policies = { policies = {
EnableTrackingProtection = { EnableTrackingProtection = {