From ba2fe3c9a626a8fb845c786383b8b23ad8355951 Mon Sep 17 00:00:00 2001 From: Corey O'Connor Date: Tue, 25 Sep 2018 11:12:33 -0700 Subject: [PATCH] firefox: disable auto updates using distribution policies. Resolves #33884 --- .../networking/browsers/firefox-bin/default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/applications/networking/browsers/firefox-bin/default.nix b/pkgs/applications/networking/browsers/firefox-bin/default.nix index 91aee7b1e8a5..c81c79349857 100644 --- a/pkgs/applications/networking/browsers/firefox-bin/default.nix +++ b/pkgs/applications/networking/browsers/firefox-bin/default.nix @@ -42,6 +42,7 @@ , channel , generated , writeScript +, writeText , xidel , coreutils , gnused @@ -69,6 +70,12 @@ let systemLocale = config.i18n.defaultLocale or "en-US"; + policies = { + DisableAppUpdate = true; + }; + + policiesJson = writeText "no-update-firefox-policy.json" (builtins.toJSON { inherit policies; }); + defaultSource = stdenv.lib.findFirst (sourceMatches "en-US") {} sources; source = stdenv.lib.findFirst (sourceMatches systemLocale) defaultSource sources; @@ -172,6 +179,10 @@ stdenv.mkDerivation { ln -s "$out/usr/lib" "$out/lib" gappsWrapperArgs+=(--argv0 "$out/bin/.firefox-wrapped") + + # See: https://github.com/mozilla/policy-templates/blob/master/README.md + mkdir -p "$out/lib/firefox-bin-${version}/distribution"; + ln -s ${policiesJson} "$out/lib/firefox-bin-${version}/distribution/policies.json"; ''; passthru.execdir = "/bin";