about summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
authorlethalman <lucabru@src.gnome.org>2015-01-19 15:00:11 +0100
committerlethalman <lucabru@src.gnome.org>2015-01-19 15:00:11 +0100
commitd957d9e6bc8c252123a921541ad17eb6041406cd (patch)
tree5b67a03b2e6cab2c538d3f59a3b74f4a9dcdde8a /pkgs/tools
parent7fdbd2a3943f8d1996c3bf9a60d52c1e691c1625 (diff)
parent24abe2b2b3f301e3a0185138b87e7a7052828248 (diff)
Merge pull request #5517 from paraseba/bumblebee
Bumblebee config to enable multiple monitors
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/X11/bumblebee/default.nix21
-rw-r--r--pkgs/tools/X11/bumblebee/nvidia-conf.patch11
-rw-r--r--pkgs/tools/X11/bumblebee/xopts.patch4
3 files changed, 32 insertions, 4 deletions
diff --git a/pkgs/tools/X11/bumblebee/default.nix b/pkgs/tools/X11/bumblebee/default.nix
index 1d5c2a129c04b..d314c7857ea6f 100644
--- a/pkgs/tools/X11/bumblebee/default.nix
+++ b/pkgs/tools/X11/bumblebee/default.nix
@@ -31,6 +31,8 @@
 # TODO: Confusing. Perhaps use "SubArch" instead of i686?
 , nvidia_x11_i686 ? null
 , virtualgl_i686 ? null
+, useDisplayDevice ? false
+, extraDeviceOptions ? ""
 }:
 with stdenv.lib;
 let
@@ -77,15 +79,26 @@ let
   allEnvs = [hostEnv] ++ optional (i686Env != null) i686Env;
   ldPathString = makeLibraryPath allEnvs;
 
+  # By default we don't want to use a display device
+  deviceOptions = if useDisplayDevice
+                  then ""
+                  else ''
+
+                         #   Disable display device
+                             Option "UseEDID" "false"
+                             Option "UseDisplayDevice" "none"
+                       ''
+                  + extraDeviceOptions;
+
 in stdenv.mkDerivation {
-  inherit name;
+  inherit name deviceOptions;
 
   src = fetchurl {
     url = "http://bumblebee-project.org/${name}.tar.gz";
     sha256 = "03p3gvx99lwlavznrpg9l7jnl1yfg2adcj8jcjj0gxp20wxp060h";
   };
 
-  patches = [ ./xopts.patch ];
+  patches = [ ./xopts.patch ./nvidia-conf.patch];
 
   preConfigure = ''
     # Substitute the path to the actual modinfo program in module.c.
@@ -98,6 +111,10 @@ in stdenv.mkDerivation {
     # Don't use a special group, just reuse wheel.
     substituteInPlace configure \
       --replace 'CONF_GID="bumblebee"' 'CONF_GID="wheel"'
+
+    # Apply configuration options
+    substituteInPlace conf/xorg.conf.nvidia \
+      --subst-var deviceOptions
   '';
 
   # Build-time dependencies of bumblebeed and optirun.
diff --git a/pkgs/tools/X11/bumblebee/nvidia-conf.patch b/pkgs/tools/X11/bumblebee/nvidia-conf.patch
new file mode 100644
index 0000000000000..f5535c417cfb4
--- /dev/null
+++ b/pkgs/tools/X11/bumblebee/nvidia-conf.patch
@@ -0,0 +1,11 @@
+--- bumblebee-3.2.1/conf/xorg.conf.nvidia
++++ bumblebee-3.2.1/conf/xorg.conf.nvidia
+@@ -29,6 +29,5 @@ Section "Device"
+     Option "ProbeAllGpus" "false"
+ 
+     Option "NoLogo" "true"
+-    Option "UseEDID" "false"
+-    Option "UseDisplayDevice" "none"
++@deviceOptions@
+ EndSection
+
diff --git a/pkgs/tools/X11/bumblebee/xopts.patch b/pkgs/tools/X11/bumblebee/xopts.patch
index f24b2a2056271..6fd3a6a0483eb 100644
--- a/pkgs/tools/X11/bumblebee/xopts.patch
+++ b/pkgs/tools/X11/bumblebee/xopts.patch
@@ -1,5 +1,5 @@
---- bumblebee-3.0/src/bbsecondary.c.orig	2012-02-05 00:03:06.003439638 +0100
-+++ bumblebee-3.0/src/bbsecondary.c	2012-02-05 00:46:38.017382619 +0100
+--- bumblebee-3.2.1/src/bbsecondary.c 2012-02-05 00:03:06.003439638 +0100
++++ bumblebee-3.2.1/src/bbsecondary.c	2012-02-05 00:46:38.017382619 +0100
 @@ -149,6 +149,8 @@
        "-sharevts",
        "-nolisten", "tcp",