summaryrefslogtreecommitdiffstats
path: root/lass/3modules
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2018-07-17 20:22:52 +0200
committertv <tv@krebsco.de>2018-07-17 20:22:52 +0200
commit3dedfb8de4dc7e741f4db5310739884fba68b5bd (patch)
tree25e2955462d2998afe04356128f9d464d1b40b52 /lass/3modules
parent75aa3b118b6c74b2e87ccf7e3da53aa06fa7d569 (diff)
parent74698c904460db569a3c6c8355c0b25a94c98800 (diff)
Merge remote-tracking branch 'prism/master'
Diffstat (limited to 'lass/3modules')
-rw-r--r--lass/3modules/xjail.nix10
1 files changed, 8 insertions, 2 deletions
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 <stockholm/lib>;
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 <stockholm/lib>;
${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} "$@"
'';