1 { config, lib, pkgs, ... }:
3 hardware.acpilight.enable = true;
4 boot.kernelModules = [ "msr" "acpi_cpufreq" ];
5 system.activationScripts.acPlug = {
8 PATH="${pkgs.kmod}/bin:$PATH"
11 ${pkgs.acpi}/bin/acpi -a | grep -q 'Adapter .*: on-line' ||
12 ${pkgs.linuxPackages.cpupower}/bin/cpupower frequency-set -g powersave
19 event = "video/brightnessdown.*";
20 action = "${pkgs.acpilight}/bin/xbacklight -dec 10";
23 event = "video/brightnessup.*";
24 action = "${pkgs.acpilight}/bin/xbacklight -inc 10";
31 ${pkgs.linuxPackages.cpupower}/bin/cpupower frequency-set -g powersave;;
32 00000001) # plugged in
33 ${pkgs.linuxPackages.cpupower}/bin/cpupower frequency-set -g ondemand;;