From feeb5bae2317e054eb307f6c998058eea8ae9fcd Mon Sep 17 00:00:00 2001 From: aszlig Date: Fri, 1 Aug 2014 05:17:23 +0200 Subject: [PATCH] Add new package xdummy, a dummy X server. This is actually a small script which just starts an X server without any real display. Right now only needed for running the test suite of the i3 window manager within the Nix chroot, but might be useful for running other tests needing a DISPLAY. Usage is just like a regular X server, so in order to start an instance for display :666, you just run it like this: xdummy :666 Signed-off-by: aszlig --- pkgs/tools/misc/xdummy/default.nix | 83 ++++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 85 insertions(+) create mode 100644 pkgs/tools/misc/xdummy/default.nix diff --git a/pkgs/tools/misc/xdummy/default.nix b/pkgs/tools/misc/xdummy/default.nix new file mode 100644 index 00000000000..30aba19930c --- /dev/null +++ b/pkgs/tools/misc/xdummy/default.nix @@ -0,0 +1,83 @@ +{ stdenv, writeText, writeScriptBin, xorg, xkeyboard_config }: + +let + xorgConfig = writeText "dummy-xorg.conf" '' + Section "ServerLayout" + Identifier "dummy_layout" + Screen 0 "dummy_screen" + InputDevice "dummy_keyboard" "CoreKeyboard" + InputDevice "dummy_mouse" "CorePointer" + EndSection + + Section "ServerFlags" + Option "DontVTSwitch" "true" + Option "AllowMouseOpenFail" "true" + Option "PciForceNone" "true" + Option "AutoEnableDevices" "false" + Option "AutoAddDevices" "false" + EndSection + + Section "Files" + ModulePath "${xorg.xorgserver}/lib/xorg/modules" + ModulePath "${xorg.xf86videodummy}/lib/xorg/modules" + XkbDir "${xkeyboard_config}/share/X11/xkb" + FontPath "${xorg.fontadobe75dpi}/lib/X11/fonts/75dpi" + FontPath "${xorg.fontadobe100dpi}/lib/X11/fonts/100dpi" + FontPath "${xorg.fontbhlucidatypewriter75dpi}/lib/X11/fonts/75dpi" + FontPath "${xorg.fontbhlucidatypewriter100dpi}/lib/X11/fonts/100dpi" + FontPath "${xorg.fontbh100dpi}/lib/X11/fonts/100dpi" + FontPath "${xorg.fontmiscmisc}/lib/X11/fonts/misc" + FontPath "${xorg.fontcursormisc}/lib/X11/fonts/misc" + EndSection + + Section "Module" + Load "dbe" + Load "extmod" + Load "freetype" + Load "glx" + EndSection + + Section "InputDevice" + Identifier "dummy_mouse" + Driver "void" + EndSection + + Section "InputDevice" + Identifier "dummy_keyboard" + Driver "void" + EndSection + + Section "Monitor" + Identifier "dummy_monitor" + HorizSync 30.0 - 130.0 + VertRefresh 50.0 - 250.0 + Option "DPMS" + EndSection + + Section "Device" + Identifier "dummy_device" + Driver "dummy" + VideoRam 192000 + EndSection + + Section "Screen" + Identifier "dummy_screen" + Device "dummy_device" + Monitor "dummy_monitor" + DefaultDepth 24 + SubSection "Display" + Depth 24 + Modes "1280x1024" + EndSubSection + EndSection + ''; + +in writeScriptBin "xdummy" '' + #!${stdenv.shell} + export XKB_BINDIR="${xorg.xkbcomp}/bin" + exec ${xorg.xorgserver}/bin/Xorg \ + -noreset \ + -logfile /dev/null \ + "$@" \ + -config "${xorgConfig}" +'' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0093566949e..b56e7659ca7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2454,6 +2454,8 @@ let xdelta = callPackage ../tools/compression/xdelta { }; + xdummy = callPackage ../tools/misc/xdummy { }; + xfsprogs = callPackage ../tools/filesystems/xfsprogs { }; xmlroff = callPackage ../tools/typesetting/xmlroff {