From a09d626053ac400da6f7965f577b18de4633d1e8 Mon Sep 17 00:00:00 2001 From: Joachim Fasting Date: Fri, 20 Oct 2017 15:24:20 +0200 Subject: [PATCH] tor-browser-bundle-bin: support installing extensions Closes https://github.com/NixOS/nixpkgs/issues/30443 --- .../browsers/tor-browser-bundle-bin/default.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/networking/browsers/tor-browser-bundle-bin/default.nix b/pkgs/applications/networking/browsers/tor-browser-bundle-bin/default.nix index 053ba1fca84..56cab9de5d0 100644 --- a/pkgs/applications/networking/browsers/tor-browser-bundle-bin/default.nix +++ b/pkgs/applications/networking/browsers/tor-browser-bundle-bin/default.nix @@ -246,6 +246,11 @@ stdenv.mkDerivation rec { # having to synchronize between local state and store. mv TorBrowser/Data/Browser/profile.default/preferences/extension-overrides.js defaults/pref/torbrowser.js + # Preload extensions by moving into the runtime instead of storing under the + # user's profile directory. + mv "$TBB_IN_STORE/TorBrowser/Data/Browser/profile.default/extensions/"* \ + "$TBB_IN_STORE/browser/extensions" + # Hard-code paths to geoip data files. TBB resolves the geoip files # relative to torrc-defaults_path but if we do not hard-code them # here, these paths end up being written to the torrc in the user's @@ -301,10 +306,6 @@ stdenv.mkDerivation rec { # easily generated by firefox at startup. rm -f "\$HOME/TorBrowser/Data/Browser/profile.default"/{compatibility.ini,extensions.ini,extensions.json} - # Ensure that we're always using the up-to-date extensions. - ln -snf "$TBB_IN_STORE/TorBrowser/Data/Browser/profile.default/extensions" \ - "\$HOME/TorBrowser/Data/Browser/profile.default/extensions" - ${optionalString pulseaudioSupport '' # Figure out some envvars for pulseaudio : "\''${XDG_RUNTIME_DIR:=/run/user/\$(id -u)}"