From dac47a8abdedda4863b56cb83941e9e16929669b Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 27 Jun 2018 23:59:14 +0200 Subject: l xjails: add vglrun option --- lass/3modules/xjail.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lass/3modules/xjail.nix') diff --git a/lass/3modules/xjail.nix b/lass/3modules/xjail.nix index 4c0023a76..8f5f05bc2 100644 --- a/lass/3modules/xjail.nix +++ b/lass/3modules/xjail.nix @@ -41,6 +41,10 @@ with import ; type = types.path; default = pkgs.writeScript "echo_lol" "echo lol"; }; + vglrun = mkOption { + type = types.bool; + default = false; + }; wm = mkOption { #TODO find type type = types.string; @@ -116,9 +120,11 @@ with import ; ${pkgs.coreutils}/bin/kill $WM_PID ${pkgs.coreutils}/bin/kill $XEPHYR_PID ''; - sudo_ = pkgs.writeDash "${cfg.name}-sudo" '' + sudo_ = pkgs.writeDash "${cfg.name}-sudo" (if cfg.vglrun then '' /var/run/wrappers/bin/sudo -u ${cfg.name} -i ${vglrun_} "$@" - ''; + '' else '' + /var/run/wrappers/bin/sudo -u ${cfg.name} -i env DISPLAY=:${cfg.display} ${cfg.script} "$@" + ''); vglrun_ = pkgs.writeDash "${cfg.name}-vglrun" '' DISPLAY=:${cfg.display} ${pkgs.virtualgl}/bin/vglrun ${cfg.extraVglrunArgs} ${cfg.script} "$@" ''; -- cgit v1.2.3