diff options
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 004a69cf09e2..b2008a201d3d 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-* |