From 9e8eba48ab46ecff67dfb27571b9adb0e2602f15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Sun, 17 Jan 2016 21:14:49 +0100 Subject: [PATCH] xorg.xorgserver: wrap Xvfb with required flags --- nixos/modules/services/x11/terminal-server.nix | 15 +-------------- pkgs/servers/x11/xorg/overrides.nix | 4 ++++ pkgs/tools/X11/xpra/default.nix | 4 ---- pkgs/tools/X11/xpra/gtk3.nix | 4 ---- 4 files changed, 5 insertions(+), 22 deletions(-) diff --git a/nixos/modules/services/x11/terminal-server.nix b/nixos/modules/services/x11/terminal-server.nix index a036e085b0bf..4d5dbd604159 100644 --- a/nixos/modules/services/x11/terminal-server.nix +++ b/nixos/modules/services/x11/terminal-server.nix @@ -9,19 +9,6 @@ with lib; -let - - # Wrap Xvfb to set some flags/variables. - xvfbWrapper = pkgs.writeScriptBin "Xvfb" - '' - #! ${pkgs.stdenv.shell} - export XKB_BINDIR=${pkgs.xorg.xkbcomp}/bin - export XORG_DRI_DRIVER_PATH=${pkgs.mesa}/lib/dri - exec ${pkgs.xorg.xorgserver}/bin/Xvfb "$@" -xkbdir ${pkgs.xkeyboard_config}/etc/X11/xkb - ''; - -in - { config = { @@ -54,7 +41,7 @@ in { description = "Terminal Server"; path = - [ xvfbWrapper pkgs.gawk pkgs.which pkgs.openssl pkgs.xorg.xauth + [ pkgs.xorgserver pkgs.gawk pkgs.which pkgs.openssl pkgs.xorg.xauth pkgs.nettools pkgs.shadow pkgs.procps pkgs.utillinux pkgs.bash ]; diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index d6e18254760f..7bd179067cd0 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -325,6 +325,10 @@ in wrapProgram $out/bin/Xephyr \ --set XKB_BINDIR "${xorg.xkbcomp}/bin" \ --add-flags "-xkbdir ${xorg.xkeyboardconfig}/share/X11/xkb" + wrapProgram $out/bin/Xvfb \ + --set XKB_BINDIR "${xorg.xkbcomp}/bin" \ + --set XORG_DRI_DRIVER_PATH ${args.mesa}/lib/dri \ + --add-flags "-xkbdir ${xorg.xkeyboardconfig}/share/X11/xkb" ''; passthru.version = version; # needed by virtualbox guest additions } else { diff --git a/pkgs/tools/X11/xpra/default.nix b/pkgs/tools/X11/xpra/default.nix index b1fdd96adb5d..c5b8db591c4c 100644 --- a/pkgs/tools/X11/xpra/default.nix +++ b/pkgs/tools/X11/xpra/default.nix @@ -33,10 +33,6 @@ buildPythonPackage rec { pillow pygtk pygobject ]; - postPatch = '' - sed -i 's|DEFAULT_XVFB_COMMAND = "Xvfb|DEFAULT_XVFB_COMMAND = "Xvfb -xkbdir ${xkeyboard_config}/etc/X11/xkb|' xpra/platform/features.py - ''; - preBuild = '' export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE $(pkg-config --cflags gtk+-2.0) $(pkg-config --cflags pygtk-2.0) $(pkg-config --cflags xtst)" ''; diff --git a/pkgs/tools/X11/xpra/gtk3.nix b/pkgs/tools/X11/xpra/gtk3.nix index 04bcd1195147..6e485dc0a052 100644 --- a/pkgs/tools/X11/xpra/gtk3.nix +++ b/pkgs/tools/X11/xpra/gtk3.nix @@ -33,10 +33,6 @@ buildPythonPackage rec { pygobject3 pycairo cython ]; - postPatch = '' - sed -i 's|DEFAULT_XVFB_COMMAND = "Xvfb|DEFAULT_XVFB_COMMAND = "Xvfb -xkbdir ${xkeyboard_config}/etc/X11/xkb|' xpra/platform/features.py - ''; - preBuild = '' export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE $(pkg-config --cflags gtk+-3.0) $(pkg-config --cflags xtst)" '';