diff options
author | Martin Weinelt <hexa@darmstadt.ccc.de> | 2022-05-16 00:26:57 +0200 |
---|---|---|
committer | Martin Weinelt <hexa@darmstadt.ccc.de> | 2022-05-19 23:12:47 +0200 |
commit | 318fae87c0b61eb2eabe6d96b5824cc6e282c513 (patch) | |
tree | a4c5aa385b993308081cbbf20c6be1139b4e88a5 /pkgs/applications/networking/browsers/firefox/common.nix | |
parent | f9e1911d34ffd1b1d3b00a3d0679e699e1e18163 (diff) |
buildMozillaMach: Add distribution identifier and distribution.ini
Adds a distribution id useful for aggregation of crash statistics. Also creates a NixOS flavor, visible through the About window, that is also exposed through telemetry data, if enabled.
Diffstat (limited to 'pkgs/applications/networking/browsers/firefox/common.nix')
-rw-r--r-- | pkgs/applications/networking/browsers/firefox/common.nix | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/pkgs/applications/networking/browsers/firefox/common.nix b/pkgs/applications/networking/browsers/firefox/common.nix index 004a69cf09e21..b2008a201d3dc 100644 --- a/pkgs/applications/networking/browsers/firefox/common.nix +++ b/pkgs/applications/networking/browsers/firefox/common.nix @@ -4,6 +4,7 @@ , updateScript ? null , binaryName ? "firefox" , application ? "browser" +, applicationName ? "Mozilla Firefox" , src , unpackPhase ? null , extraPatches ? [] @@ -18,6 +19,7 @@ { lib +, pkgs , stdenv # build time @@ -161,6 +163,22 @@ let ln -s $lib $out/lib/wasm32-wasi done ''; + + distributionIni = pkgs.writeText "distribution.ini" (lib.generators.toINI {} { + # Some light branding indicating this build uses our distro preferences + Global = { + id = "nixos"; + version = "1.0"; + about = "${applicationName} for NixOS"; + }; + Preferences = { + # These values are exposed through telemetry + "app.distributor" = "nixos"; + "app.distributor.channel" = "nixpkgs"; + "app.partner.nixos" = "nixos"; + }; + }); + in buildStdenv.mkDerivation ({ @@ -290,6 +308,7 @@ buildStdenv.mkDerivation ({ "--enable-application=${application}" "--enable-default-toolkit=cairo-gtk3${lib.optionalString waylandSupport "-wayland"}" "--enable-system-pixman" + "--with-distribution-id=org.nixos" "--with-libclang-path=${llvmPackages.libclang.lib}/lib" "--with-system-ffi" "--with-system-icu" @@ -429,7 +448,11 @@ buildStdenv.mkDerivation ({ cd mozobj ''; - postInstall = lib.optionalString buildStdenv.isLinux '' + postInstall = '' + # Install distribution customizations + install -Dvm644 ${distributionIni} $out/lib/${binaryName}/distribution/distribution.ini + + '' + lib.optionalString buildStdenv.isLinux '' # Remove SDK cruft. FIXME: move to a separate output? rm -rf $out/share/idl $out/include $out/lib/${binaryName}-devel-* |