diff options
author | Martin Weinelt <mweinelt@users.noreply.github.com> | 2022-05-20 23:17:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-20 23:17:26 +0200 |
commit | 51717872195aabaff5ba415b55f180d0f26410fe (patch) | |
tree | ab7b640f26bd1d34d5babe8f104e5696d3825862 /pkgs | |
parent | 61e7aeee528d34501f217d5712ba04c15c84862e (diff) | |
parent | 6cdf90a219dbca46f75bf74bfdfc01bf998acbd5 (diff) |
Merge pull request #173205 from mweinelt/mach-distribution-id
buildMozillaMach: Add distribution identifier and distribution.ini
Diffstat (limited to 'pkgs')
4 files changed, 32 insertions, 10 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-* diff --git a/pkgs/applications/networking/browsers/firefox/packages.nix b/pkgs/applications/networking/browsers/firefox/packages.nix index 257c65edeceff..d533593c7e641 100644 --- a/pkgs/applications/networking/browsers/firefox/packages.nix +++ b/pkgs/applications/networking/browsers/firefox/packages.nix @@ -29,6 +29,7 @@ rec { firefox-esr-91 = buildMozillaMach rec { pname = "firefox-esr"; version = "91.9.0esr"; + applicationName = "Mozilla Firefox ESR"; src = fetchurl { url = "mirror://mozilla/firefox/releases/${version}/source/firefox-${version}.source.tar.xz"; sha512 = "fd69d489429052013d2c1b8b766a47920ecee62f0688505758f593b27ae66d6343b9107163749406251aedebdf836147e4d562415a811b04d7ab2ae31e32f133"; diff --git a/pkgs/applications/networking/browsers/librewolf/default.nix b/pkgs/applications/networking/browsers/librewolf/default.nix index 8f3100de970d4..bec0c3a9eda9e 100644 --- a/pkgs/applications/networking/browsers/librewolf/default.nix +++ b/pkgs/applications/networking/browsers/librewolf/default.nix @@ -5,6 +5,7 @@ let in (buildMozillaMach rec { pname = "librewolf"; + applicationName = "LibreWolf"; binaryName = "librewolf"; version = librewolf-src.packageVersion; src = librewolf-src.firefox; diff --git a/pkgs/applications/networking/mailreaders/thunderbird/packages.nix b/pkgs/applications/networking/mailreaders/thunderbird/packages.nix index 46191b2b3185d..faabc3058c7f5 100644 --- a/pkgs/applications/networking/mailreaders/thunderbird/packages.nix +++ b/pkgs/applications/networking/mailreaders/thunderbird/packages.nix @@ -1,17 +1,11 @@ -{ stdenv, lib, callPackage, fetchurl, fetchpatch, nixosTests }: - -let - common = opts: callPackage (import ../../browsers/firefox/common.nix opts) { - webrtcSupport = false; - geolocationSupport = false; - }; -in +{ stdenv, lib, buildMozillaMach, callPackage, fetchurl, fetchpatch, nixosTests }: rec { - thunderbird = (common rec { + thunderbird = (buildMozillaMach rec { pname = "thunderbird"; version = "91.9.0"; application = "comm/mail"; + applicationName = "Mozilla Thunderbird"; binaryName = pname; src = fetchurl { url = "mirror://mozilla/thunderbird/releases/${version}/source/thunderbird-${version}.source.tar.xz"; @@ -36,6 +30,9 @@ rec { attrPath = "thunderbird-unwrapped"; }; }).override { + geolocationSupport = false; + webrtcSupport = false; + pgoSupport = false; # console.warn: feeds: "downloadFeed: network connection unavailable" }; } |