summary refs log tree commit diff
path: root/pkgs/tools/misc
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2014-08-01 05:51:57 +0200
committeraszlig <aszlig@redmoonstudios.org>2014-08-01 05:51:57 +0200
commit57781346d77a8748e830e4fe7044e87136bda4ec (patch)
tree38767c1e2140e5a8c4b5838df56b01196c0e7f55 /pkgs/tools/misc
parent181cdb7cc872cfcddd8c8bd51adac6bfb502cc44 (diff)
parent31e77f5096fe8bce81d4d520cee9ccac9b81d7f0 (diff)
downloadnixlib-57781346d77a8748e830e4fe7044e87136bda4ec.tar
nixlib-57781346d77a8748e830e4fe7044e87136bda4ec.tar.gz
nixlib-57781346d77a8748e830e4fe7044e87136bda4ec.tar.bz2
nixlib-57781346d77a8748e830e4fe7044e87136bda4ec.tar.lz
nixlib-57781346d77a8748e830e4fe7044e87136bda4ec.tar.xz
nixlib-57781346d77a8748e830e4fe7044e87136bda4ec.tar.zst
nixlib-57781346d77a8748e830e4fe7044e87136bda4ec.zip
Merge branch 'i3-tests'.
The reason I went through this whole journey of gathering dependencies
and debugging just in order to get i3 tests working was because I wanted
to supply test cases to a small patch I wrote for the upstream project.

This adds/updates quite a few Perl packages and a X dummy helper, which
are all needed in order to successfully run the test suite.
Diffstat (limited to 'pkgs/tools/misc')
-rw-r--r--pkgs/tools/misc/xdummy/default.nix83
1 files changed, 83 insertions, 0 deletions
diff --git a/pkgs/tools/misc/xdummy/default.nix b/pkgs/tools/misc/xdummy/default.nix
new file mode 100644
index 000000000000..30aba19930c7
--- /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}"
+''