tor-browser-bundle-bin: support installing extensions

Closes https://github.com/NixOS/nixpkgs/issues/30443
This commit is contained in:
Joachim Fasting 2017-10-20 15:24:20 +02:00
parent eba08858cc
commit a09d626053
No known key found for this signature in database
GPG Key ID: 6F93BCF559339360

View File

@ -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)}"