tor-browser: associate with .onion URLs

This commit is contained in:
2024-08-01 18:34:38 +00:00
parent bb420bd45d
commit c07eaba873

View File

@@ -1,19 +1,23 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
sane.programs.tor-browser = { sane.programs.tor-browser = {
# packageUnwrapped = pkgs.tor-browser.override { packageUnwrapped = pkgs.tor-browser.overrideAttrs (upstream: {
# # hardenedMalloc solves an "unable to connect to Tor" error when pressing the "connect" button # add `--allow-remote` flag so that i can do `tor-browser http://...` to open in an existing instance.
# # - required as recently as 2023/07/14 preBuild = (upstream.preBuild or "") + ''
# # - no longer required as of 2024/01/27 makeWrapper() {
# useHardenedMalloc = false; makeShellWrapper "$@" --add-flags --allow-remote
# }; }
'';
});
sandbox.method = "bwrap"; sandbox.method = "bwrap";
sandbox.wrapperType = "inplace"; # trivial package, so cheaper to wrap in-place sandbox.wrapperType = "inplace"; # trivial package, so cheaper to wrap in-place
sandbox.net = "clearnet"; # tor over VPN wouldn't make sense sandbox.net = "clearnet"; # tor over VPN wouldn't make sense
sandbox.whitelistAudio = true; sandbox.whitelistAudio = true;
sandbox.whitelistDbus = [ "user" ]; #< so `tor-browser http://...` can open using an existing instance
sandbox.whitelistWayland = true; sandbox.whitelistWayland = true;
persist.byStore.ephemeral = [ persist.byStore.ephemeral = [
".local/share/tor-browser" ".local/share/tor-browser"
]; ];
mime.urlAssociations."^https?://.+\.onion" = "torbrowser.desktop";
}; };
} }