Add wsudo command

This commit is contained in:
Fabian Hauser 2021-06-06 16:27:14 +02:00
parent 82136c3045
commit 5976b79b5e

View file

@ -59,7 +59,19 @@ let
echo "Starting '$COMMAND' in env '$ENV_FILE'" echo "Starting '$COMMAND' in env '$ENV_FILE'"
${pkgs.nix}/bin/nix-shell ''${ENV_FILE} --run "$COMMAND" ${pkgs.nix}/bin/nix-shell ''${ENV_FILE} --run "$COMMAND"
''; '';
wsudo = with pkgs.xorg; pkgs.writeScriptBin "wsudo" ''
#!/usr/bin/env bash
#small script to enable root access to x-windows system
${xhost}/bin/xhost +SI:localuser:root
sudo $1
#disable root access after application terminates
${xhost}/bin/xhost -SI:localuser:root
#print access status to allow verification that root access was remov
ed
${xhost}/bin/xhost
'';
in { in {
home-manager.users.fhauser.home.packages = home-manager.users.fhauser.home.packages =
[ passbemenu threema-vpn threema-env ]; [ passbemenu threema-vpn threema-env wsudo ];
} }