summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2014-05-02 14:32:47 +0400
committerMichael Raskin <7c6f434c@mail.ru>2014-05-02 14:32:47 +0400
commiteef9a8ac2a30b495ff7184382ed0dbd73b3b88e4 (patch)
treef97eab6a6aeb0a587156e054b23d46b0cd7538c8 /nixos/modules
parentde26954b3058868f55075d4d723cab26dfe49832 (diff)
downloadnixpkgs-eef9a8ac2a30b495ff7184382ed0dbd73b3b88e4.tar
nixpkgs-eef9a8ac2a30b495ff7184382ed0dbd73b3b88e4.tar.gz
nixpkgs-eef9a8ac2a30b495ff7184382ed0dbd73b3b88e4.tar.bz2
nixpkgs-eef9a8ac2a30b495ff7184382ed0dbd73b3b88e4.tar.lz
nixpkgs-eef9a8ac2a30b495ff7184382ed0dbd73b3b88e4.tar.xz
nixpkgs-eef9a8ac2a30b495ff7184382ed0dbd73b3b88e4.tar.zst
nixpkgs-eef9a8ac2a30b495ff7184382ed0dbd73b3b88e4.zip
On my system OpenGL with bumblebee seems to require libudev in LD_LIBRARY_PATH. Fix that, fix bumblebee module loading and make the socket group configurable
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/hardware/opengl.nix1
-rw-r--r--nixos/modules/hardware/video/bumblebee.nix10
2 files changed, 10 insertions, 1 deletions
diff --git a/nixos/modules/hardware/opengl.nix b/nixos/modules/hardware/opengl.nix
index 2d5643d4d94..096f7e2c097 100644
--- a/nixos/modules/hardware/opengl.nix
+++ b/nixos/modules/hardware/opengl.nix
@@ -16,6 +16,7 @@ let
       [ p.mesa_drivers
         p.mesa_noglu # mainly for libGL
         (if cfg.s3tcSupport then p.libtxc_dxtn else p.libtxc_dxtn_s2tc)
+	p.udev
       ];
   };
 
diff --git a/nixos/modules/hardware/video/bumblebee.nix b/nixos/modules/hardware/video/bumblebee.nix
index f06139adc44..52dea798f87 100644
--- a/nixos/modules/hardware/video/bumblebee.nix
+++ b/nixos/modules/hardware/video/bumblebee.nix
@@ -17,6 +17,12 @@ with lib;
         Only nvidia driver is supported so far.
       '';
     };
+    hardware.bumblebee.group = mkOption {
+      default = "wheel";
+      example = "video";
+      type = types.uniq types.str;
+      description = ''Group for bumblebee socket'';
+    };
   };
 
   config = mkIf config.hardware.bumblebee.enable {
@@ -29,13 +35,15 @@ with lib;
     systemd.services.bumblebeed = {
       description = "Bumblebee Hybrid Graphics Switcher";
       wantedBy = [ "display-manager.service" ];
-      script = "bumblebeed --use-syslog";
+      script = "bumblebeed --use-syslog -g ${config.hardware.bumblebee.group}";
       path = [ kernel.bbswitch pkgs.bumblebee ];
       serviceConfig = {
         Restart = "always";
         RestartSec = 60;
         CPUSchedulingPolicy = "idle";
       };
+      environment.LD_LIBRARY_PATH="/run/opengl-driver/lib/";
+      environment.MODULE_DIR="/run/current-system/kernel-modules/lib/modules/";
     };
   };
 }