nixpkgs/pkgs/applications/networking/browsers/firefox
aszlig 9744ff74ad
firefox: Improve detecting signing requirements
Firefox 61 started to enforce signatures for add-ons and since
commit d031843a1e, we get an evaluation
error that recommends the user to switch to Firefox ESR.

This isn't an option for everyone and as I also pointed out in the pull
request[1] introducing the above commit, I've been building Firefox like
this:

  let
    firefoxNoSigning = firefox-unwrapped.overrideAttrs (lib.const {
      MOZ_REQUIRE_SIGNING = false;
    });
  in wrapFirefox firefoxNoSigning {
    nixExtensions = ...;
  }

However, this only works after manually modifying nixpkgs (or copy &
paste wrapper.nix elsewhere) every time I want to have a new Firefox
version. Of course, this gets annoying and tedious after a while, so
this motivated me to properly fix this to not only check for an ESR
version but also check the value of MOZ_REQUIRE_SIGNING.

Note that I'm using toString here to check for the value because there
are several ways (false, null, "", ...) to set the environment variable
to an empty string and toString makes sure that it really is the desired
behaviour. I specifically checked the Firefox source and also tested
this with multiple values and only building with MOZ_REQUIRE_SIGNING
set to an empty string seems to work (no "0", "false" or other
variants).

Additionally, there is another method to allow unsigned add-ons, which
is by using the --with-unsigned-addon-scopes configure option[2].
Unfortunately, this does not work with nixExtensions because we don't
have (or want) a central directory where those add-ons reside.

Given that nixExtensions disallows manually installing add-ons, setting
MOZ_REQUIRE_SIGNING to false should be safe in this case.

[1]: https://github.com/NixOS/nixpkgs/pull/133504
[2]: https://bugs.archlinux.org/task/63075

Signed-off-by: aszlig <aszlig@nix.build>
2022-06-21 11:54:08 +02:00
..
common.nix Merge master into staging-next 2022-06-13 00:02:20 +00:00
env_var_for_system_dir-ff86.patch firefox: 85.0.2 -> 86.0 2021-02-24 15:06:49 +01:00
no-buildconfig-ffx90.patch firefox: 89.0.2 -> 90.0 2021-07-12 16:47:24 +02:00
no-buildconfig-ffx96.patch firefox: 95.0.2 -> 96.0 2022-01-11 00:35:00 +01:00
packages.nix firefox-unwrapped: 101.0 -> 101.0.1 2022-06-10 22:35:36 +02:00
update.nix firefox/update.nix: Use fingerprint instead of keyid 2021-06-17 00:07:09 +09:00
wrapper.nix firefox: Improve detecting signing requirements 2022-06-21 11:54:08 +02:00