From 49768ca8ffbdb9796763e4cbc85291cf0270a1c8 Mon Sep 17 00:00:00 2001 From: "ambrop7@gmail.com" Date: Sat, 15 Mar 2014 12:17:00 +0100 Subject: [PATCH 1/2] power-management: Don't enable acpid. Running acpid along with systemd will cause double handling of acpi events. --- nixos/modules/config/power-management.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/nixos/modules/config/power-management.nix b/nixos/modules/config/power-management.nix index 7299136235ed..c80b1ec3ddca 100644 --- a/nixos/modules/config/power-management.nix +++ b/nixos/modules/config/power-management.nix @@ -65,9 +65,6 @@ in config = mkIf cfg.enable { - # Enable the ACPI daemon. Not sure whether this is essential. - services.acpid.enable = true; - boot.kernelModules = [ "acpi_cpufreq" "powernow-k8" "cpufreq_performance" "cpufreq_powersave" "cpufreq_ondemand" "cpufreq_conservative" From e5cc6d3552654097bccf9e26dba4ee2be13dc8ce Mon Sep 17 00:00:00 2001 From: "ambrop7@gmail.com" Date: Mon, 17 Mar 2014 19:27:06 +0100 Subject: [PATCH 2/2] Enable acpid if nvidia driver is being used. The NVidia driver wants to connect to acpid to receive ACPI events. --- nixos/modules/services/x11/xserver.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix index 2677f7584565..206cf128a9bd 100644 --- a/nixos/modules/services/x11/xserver.nix +++ b/nixos/modules/services/x11/xserver.nix @@ -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;