Bumblebee config to enable multiple monitors

Added configurations to `bumblebee` package to easy multiple monitors on Optimus
machines.

The behaviour of the default `bumblebee` package hasn't change, so this change
is backwards compatible. Users who want to connect a monitor to their discrete
card should use the package `bumblebee_display` instead.

Also added new configuration option to nixos bumblebee module:

```
hardware.bumblebee.connectDisplay = true
```

will enable the new configuration, but the default is still false.
This commit is contained in:
Sebastián Bernardo Galkin
2014-12-30 19:17:42 -08:00
parent c2af4f3ea8
commit 24abe2b2b3
5 changed files with 57 additions and 7 deletions
+19 -2
View File
@@ -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.
@@ -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
+2 -2
View File
@@ -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",