summary refs log tree commit diff
path: root/nixos
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 /nixos
parent7fdbd2a3943f8d1996c3bf9a60d52c1e691c1625 (diff)
parent24abe2b2b3f301e3a0185138b87e7a7052828248 (diff)
downloadnixlib-d957d9e6bc8c252123a921541ad17eb6041406cd.tar
nixlib-d957d9e6bc8c252123a921541ad17eb6041406cd.tar.gz
nixlib-d957d9e6bc8c252123a921541ad17eb6041406cd.tar.bz2
nixlib-d957d9e6bc8c252123a921541ad17eb6041406cd.tar.lz
nixlib-d957d9e6bc8c252123a921541ad17eb6041406cd.tar.xz
nixlib-d957d9e6bc8c252123a921541ad17eb6041406cd.tar.zst
nixlib-d957d9e6bc8c252123a921541ad17eb6041406cd.zip
Merge pull request #5517 from paraseba/bumblebee
Bumblebee config to enable multiple monitors
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/hardware/video/bumblebee.nix23
1 files changed, 20 insertions, 3 deletions
diff --git a/nixos/modules/hardware/video/bumblebee.nix b/nixos/modules/hardware/video/bumblebee.nix
index 7b48d9d1fcf5..e20ebc3041e7 100644
--- a/nixos/modules/hardware/video/bumblebee.nix
+++ b/nixos/modules/hardware/video/bumblebee.nix
@@ -1,7 +1,13 @@
 { config, lib, pkgs, ... }:
 
-let kernel = config.boot.kernelPackages; in
 with lib;
+let
+  kernel = config.boot.kernelPackages;
+  bumblebee = if config.hardware.bumblebee.connectDisplay
+              then pkgs.bumblebee_display
+              else pkgs.bumblebee;
+
+in
 
 {
 
@@ -23,6 +29,17 @@ with lib;
       type = types.uniq types.str;
       description = ''Group for bumblebee socket'';
     };
+    hardware.bumblebee.connectDisplay = mkOption {
+      default = false;
+      type = types.bool;
+      description = ''
+        Set to true if you intend to connect your discrete card to a
+        monitor. This option will set up your Nvidia card for EDID
+        discovery and to turn on the monitor signal.
+
+        Only nvidia driver is supported so far.
+      '';
+    };
   };
 
   config = mkIf config.hardware.bumblebee.enable {
@@ -30,13 +47,13 @@ with lib;
     boot.kernelModules = [ "bbswitch" ];
     boot.extraModulePackages = [ kernel.bbswitch kernel.nvidia_x11 ];
 
-    environment.systemPackages = [ pkgs.bumblebee pkgs.primus ];
+    environment.systemPackages = [ bumblebee pkgs.primus ];
 
     systemd.services.bumblebeed = {
       description = "Bumblebee Hybrid Graphics Switcher";
       wantedBy = [ "display-manager.service" ];
       script = "bumblebeed --use-syslog -g ${config.hardware.bumblebee.group}";
-      path = [ kernel.bbswitch pkgs.bumblebee ];
+      path = [ kernel.bbswitch bumblebee ];
       serviceConfig = {
         Restart = "always";
         RestartSec = 60;