eosyn/xvfb-run.nix

21 lines
422 B
Nix
Raw Normal View History

2024-11-16 21:05:58 +01:00
{ lib, writeShellApplication, cage }:
writeShellApplication {
name = "xvfb-run";
text = ''
# Discard all options
while [[ "$1" =~ ^- ]]; do
case "$1" in
(-e|-f|-n|-p|-s|-w) shift ;&
(*) shift ;;
esac
done
WLR_BACKENDS=headless \
WLR_LIBINPUT_NO_DEVICES=1 \
WLR_RENDERER=pixman \
XDG_RUNTIME_DIR="$(mktemp -d)" \
exec '${lib.getExe cage}' -- "$@"
'';
}