host/shared/tor: improve some configs

This commit is contained in:
Dmitriy Pleshevskiy 2024-04-07 02:45:20 +03:00
parent 296db5b5fb
commit 185d4548bd
Signed by: pleshevskiy
GPG key ID: 17041163DA10A9A2

View file

@ -8,20 +8,19 @@ let
pulseaudioSupport = true; pulseaudioSupport = true;
}; };
hostRunTorBrowser = pkgs.writeScriptBin "run-tor-browser" '' hostRunTorBrowser = pkgs.writeScriptBin "tor-browser" ''
set -x
${pkgs.socat}/bin/socat -d TCP-LISTEN:6000,fork,bind=192.168.7.10 UNIX-CONNECT:/tmp/.X11-unix/X0 & ${pkgs.socat}/bin/socat -d TCP-LISTEN:6000,fork,bind=192.168.7.10 UNIX-CONNECT:/tmp/.X11-unix/X0 &
${pkgs.xorg.xhost}/bin/xhost + ${pkgs.xorg.xhost}/bin/xhost +
ssh -X browser@192.168.7.11 run-tor-browser ssh -X browser@192.168.7.11 tor-browser
${pkgs.xorg.xhost}/bin/xhost -
''; '';
clientRunTorBrowser = pkgs.writeScriptBin "run-tor-browser" '' clientRunTorBrowser = pkgs.writeScriptBin "tor-browser" ''
set -x
PULSE_SERVER=tcp:192.168.7.10:4713 \ PULSE_SERVER=tcp:192.168.7.10:4713 \
XAUTHORITY="/home/browser/.Xauthority" \ XAUTHORITY="/home/browser/.Xauthority" \
DBUS_SESSION_BUS_ADDRESS="" \ DBUS_SESSION_BUS_ADDRESS="" \
DISPLAY=192.168.7.10:0.0 \ DISPLAY=192.168.7.10:0.0 \
${pkgs.apulse}/bin/apulse tor-browser $@ ${pkgs.apulse}/bin/apulse ${torBrowser}/bin/tor-browser $@
''; '';
in in
{ {
@ -64,7 +63,7 @@ in
home = "/home/browser"; home = "/home/browser";
openssh.authorizedKeys.keys = data.publicKeys.users.jan; openssh.authorizedKeys.keys = data.publicKeys.users.jan;
extraGroups = [ "audio" "video" ]; extraGroups = [ "audio" "video" ];
packages = [ clientRunTorBrowser torBrowser ]; packages = [ clientRunTorBrowser ];
}; };
}; };
}; };