Enable acpid if nvidia driver is being used.

The NVidia driver wants to connect to acpid to receive ACPI events.
This commit is contained in:
ambrop7@gmail.com 2014-03-17 19:27:06 +01:00
parent 49768ca8ff
commit e5cc6d3552

View file

@ -24,6 +24,11 @@ let
driverNames = config.hardware.opengl.videoDrivers;
needsAcpid =
(elem "nvidia" driverNames) ||
(elem "nvidiaLegacy173" driverNames) ||
(elem "nvidiaLegacy304" driverNames);
drivers = flip map driverNames
(name: { inherit name; driverName = name; } //
attrByPath [name] (if (hasAttr ("xf86video" + name) xorg) then { modules = [(getAttr ("xf86video" + name) xorg) ]; } else throw "unknown video driver `${name}'") knownVideoDrivers);
@ -428,6 +433,8 @@ in
++ optional (elem "virtualbox" driverNames) xorg.xrefresh
++ optional (elem "ati_unfree" driverNames) kernelPackages.ati_drivers_x11;
services.acpid.enable = mkIf needsAcpid true;
environment.pathsToLink =
[ "/etc/xdg" "/share/xdg" "/share/applications" "/share/icons" "/share/pixmaps" ];
@ -436,7 +443,8 @@ in
systemd.services."display-manager" =
{ description = "X11 Server";
after = [ "systemd-udev-settle.service" "local-fs.target" ];
after = [ "systemd-udev-settle.service" "local-fs.target" ]
++ optional needsAcpid "acpid.service";
restartIfChanged = false;