mirror of
https://github.com/alyraffauf/nixcfg.git
synced 2024-11-28 14:49:17 -05:00
21 lines
585 B
Nix
21 lines
585 B
Nix
{
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}: {
|
|
boot.kernel.sysctl = {
|
|
"kernel.nmi_watchdog" = lib.mkDefault 0;
|
|
};
|
|
|
|
services = {
|
|
power-profiles-daemon.enable = lib.mkDefault true;
|
|
|
|
udev.extraRules = ''
|
|
SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_NAME}=="ACAD", ATTR{online}=="1", ACTION=="change", RUN+="${lib.getExe pkgs.power-profiles-daemon} set balanced"
|
|
SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_NAME}=="ACAD", ATTR{online}=="0", ACTION=="change", RUN+="${lib.getExe pkgs.power-profiles-daemon} set power-saver"
|
|
'';
|
|
|
|
upower.enable = lib.mkDefault true;
|
|
};
|
|
}
|