From eef9a8ac2a30b495ff7184382ed0dbd73b3b88e4 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Fri, 2 May 2014 14:32:47 +0400 Subject: 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 --- nixos/modules/hardware/opengl.nix | 1 + nixos/modules/hardware/video/bumblebee.nix | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) 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/"; }; }; } -- cgit 1.4.1