{ config, lib, pkgs, ... }:
{
hardware.acpilight.enable = true;
-boot.kernelModules = [ "acpi_cpufreq" ];
-system.activationScripts.acPlug = ''
- PATH="${pkgs.kmod}/bin:$PATH"
+boot.kernelModules = [ "msr" "acpi_cpufreq" ];
+systemd.services.acpid.postStart = ''
${pkgs.acpi}/bin/acpi -a | grep -q 'Adapter .*: on-line' ||
${pkgs.linuxPackages.cpupower}/bin/cpupower frequency-set -g powersave
'';