1 { config, lib, pkgs, ... }:
3 hardware.acpilight.enable = true;
4 boot.kernelModules = [ "acpi_cpufreq" ];
5 system.activationScripts.acPlug = ''
6 PATH="${pkgs.kmod}/bin:$PATH"
7 ${pkgs.acpi}/bin/acpi -a | grep -q 'Adapter .*: on-line' ||
8 ${pkgs.linuxPackages.cpupower}/bin/cpupower frequency-set -g powersave
14 event = "video/brightnessdown.*";
15 action = "${pkgs.acpilight}/bin/xbacklight -dec 10";
18 event = "video/brightnessup.*";
19 action = "${pkgs.acpilight}/bin/xbacklight -inc 10";
26 ${pkgs.linuxPackages.cpupower}/bin/cpupower frequency-set -g powersave;;
27 00000001) # plugged in
28 ${pkgs.linuxPackages.cpupower}/bin/cpupower frequency-set -g ondemand;;