diff options
author | jeschli <jeschli@gmail.com> | 2018-07-09 14:31:18 +0200 |
---|---|---|
committer | jeschli <jeschli@gmail.com> | 2018-07-09 14:31:18 +0200 |
commit | d1c6baf00e98a0229fc7fd96874623efc8417b05 (patch) | |
tree | eaba9481ed208af1086690a9c07ca948b047389a /lass/3modules/xjail.nix | |
parent | b439342e7533e3f695db8a46576c54d180f56a58 (diff) | |
parent | d6df7ae483b984b90bdc8d4540301ef394885a98 (diff) |
Merge remote-tracking branch 'origin/staging/jeschli'
Diffstat (limited to 'lass/3modules/xjail.nix')
-rw-r--r-- | lass/3modules/xjail.nix | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lass/3modules/xjail.nix b/lass/3modules/xjail.nix index 325ebcc99..8f5f05bc2 100644 --- a/lass/3modules/xjail.nix +++ b/lass/3modules/xjail.nix @@ -41,10 +41,14 @@ 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; - default = "${pkgs.writeHaskell "xephyrify-xmonad" { + default = "${pkgs.writeHaskellPackage "xephyrify-xmonad" { executables.xmonad = { extra-depends = [ "containers" @@ -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} "$@" ''; |