From 0b8ecc3096445e4e800b3d6504d2d473407a0149 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Sun, 24 Nov 2024 00:17:31 -0500 Subject: [PATCH] fix webgl firefox without breaking policies --- home/nix/programs/firefox.nix | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/home/nix/programs/firefox.nix b/home/nix/programs/firefox.nix index 1b684a2..61f4c17 100644 --- a/home/nix/programs/firefox.nix +++ b/home/nix/programs/firefox.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, nixgl, ... }: let lock-false = { Value = false; @@ -8,11 +8,8 @@ Value = true; Status = "locked"; }; - in -{ - programs.firefox = { - enable = true; - package = pkgs.firefox.override { + nixGL = "${nixgl.packages.${pkgs.system}.nixGLIntel}/bin/nixGLIntel"; + my-firefox = (pkgs.firefox.override { extraPrefs = '' // @@ -25,18 +22,6 @@ 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); @@ -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 = { EnableTrackingProtection = {