From 351fc8133d07829b20e7c48bcff50f6f06cd3693 Mon Sep 17 00:00:00 2001 From: aszlig Date: Wed, 6 Dec 2023 16:28:35 +0100 Subject: firefox: Fix evaluation with newer nixpkgs A recent nixpkgs change[1] added an explicit requireSigning attribute, which in turn sets MOZ_REQUIRE_SIGNING to a zero-width string. The change also changed the check in the Firefox wrapper to check whether the browser derivation exposes a requireSigning attribute, which it doesn't. Since I'm busy with other things and just want my machine configuration to evaluate, I quickly worked around this by re-adding the requireSigning (and allowAddonSideload for that matter) to the derivation attributes on our side. [1]: https://github.com/NixOS/nixpkgs/commit/c4c81ac8a219e8725dae514f49c Signed-off-by: aszlig --- pkgs/aszlig/firefox/default.nix | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'pkgs') diff --git a/pkgs/aszlig/firefox/default.nix b/pkgs/aszlig/firefox/default.nix index 12fb7786..b1c68a05 100644 --- a/pkgs/aszlig/firefox/default.nix +++ b/pkgs/aszlig/firefox/default.nix @@ -1,5 +1,5 @@ { lib, writeTextFile, writers, wrapFirefox, fetchFirefoxAddon -, firefox-unwrapped, tridactyl-native +, firefoxPackages, buildMozillaMach, tridactyl-native }: let @@ -9,7 +9,14 @@ let extensions = lib.mapAttrs mkExtension (lib.importJSON ./addons.json); - firefoxNoSigning = (firefox-unwrapped.override { + firefoxNoSigning = ((firefoxPackages.override { + # XXX: The buildMozillaMach gets passed its options via a non-overridable + # attribute set, so we need to wrap it here. + buildMozillaMach = opts: buildMozillaMach (opts // { + requireSigning = false; + allowAddonSideload = true; + }); + }).firefox.override { crashreporterSupport = false; drmSupport = false; googleAPISupport = false; @@ -18,15 +25,19 @@ let ./mute-by-default.patch ./dont-block-about-pages.patch ]; - MOZ_REQUIRE_SIGNING = false; - }); + }) // { + # XXX: This is needed because the requireSigning and allowAddonSideload are + # not passed through with the new buildMozillaMach function. + requireSigning = false; + allowAddonSideload = true; + }; jsString = str: builtins.toJSON (toString str); in wrapFirefox firefoxNoSigning { nixExtensions = lib.attrValues extensions; - extraNativeMessagingHosts = [ + nativeMessagingHosts = [ (writeTextFile { name = "ff2mpv-native"; destination = "/lib/mozilla/native-messaging-hosts/ff2mpv.json"; -- cgit 1.4.1