anchor.diff:        nativeBuildInputs = [ makeWrapper lndir ];
         buildInputs = lib.optional (browser ? gtk3) browser.gtk3;
   
  +
         buildCommand = lib.optionalString stdenv.isDarwin ''
           mkdir -p $out/Applications
           cp -R --no-preserve=mode,ownership ${browser}/Applications/${browserName}.app $out/Applications
  
positive.code:         # For manpages, in case the program supplies them
          mkdir -p $out/nix-support
          echo ${browser} > $out/nix-support/propagated-user-env-packages
        '';
  
        preferLocalBuild = true;
  
negative.code:             ++ pkcs11Modules;
        gtk_modules = [ libcanberra-gtk2 ];
  
        #########################
        #                       #
        #   EXTRA PREF CHANGES  #
        #                       #
        #########################
        policiesJson = builtins.toFile "policies.json"
          (builtins.toJSON enterprisePolicies);
  
        extensions = builtins.map (a:
          if ! (builtins.hasAttr "name" a) || ! (builtins.isString a.name) then
            throw "Firefox addon needs a name attribute"
          else if ! (builtins.hasAttr "url" a) || ! (builtins.isString a.url) then
            throw "Addon ${a.pname} needs an url"
          else if ! (builtins.hasAttr "sha256" a) || ! (builtins.isString a.sha256) then
            throw "Addon ${a.pname} needs an sha256 checksum"
          else stdenv.mkDerivation rec {
            pname = a.name;
            version = "1.0";
            src = fetchurl {
              url = a.url;
              sha256 = a.sha256;
            };
  
            phases = [ "buildPhase" ];
  
            extid = "${a.sha256}@${a.name}";
  
            buildInputs = [ zip unzip jq ];
  
            buildPhase = ''
              UUID="${extid}"
              mkdir -p "$out/$UUID"
              unzip -q ${src} -d "$out/$UUID"
              NEW_MANIFEST=$(jq '. + {"applications": { "gecko": { "id": "${extid}" }}, "browser_specific_settings":{"gecko":{"id": "${extid}"}}}' "$out/$UUID/manifest.json")
              echo "$NEW_MANIFEST" > "$out/$UUID/manifest.json"
              cd "$out/$UUID"
              zip -r -q -FS "$out/$UUID.xpi" *
              rm -r "$out/$UUID"
              '';
                }
        ) extraExtensions;
  
        enterprisePolicies =
        {
          policies = {
            DisableAppUpdate = true;
          } //
          {
            ExtensionSettings = {
              "*" = {
                  blocked_install_message = "You can't have manual extension mixed with nix extensions";
                  installation_mode = "blocked";
                };
  
            } // lib.foldr (e: ret:
                ret // {
                  "${e.extid}" = {
                    installation_mode = "allowed";
                  };
                }
              ) {} extensions;
          }
          // extraPolicies;
        };
  
        mozillaCfg = builtins.toFile "mozilla.cfg" ''
  // First line must be a comment
  
          // Disables addon signature checking
          // to be able to install addons that do not have an extid
          // Security is maintained because only user whitelisted addons
          // with a checksum can be installed
          lockPref("xpinstall.signatures.required", false);
          ${extraPrefs}
        '';
  
        #############################
        #                           #
        #   END EXTRA PREF CHANGES  #
        #                           #
        #############################
  
      in stdenv.mkDerivation {
        inherit pname version;
  
  