organize modules
This commit is contained in:
parent
d7453265a1
commit
d0d4bf9ddb
21 changed files with 54 additions and 69 deletions
22
modules/hardware/misc/battery-power.nix
Normal file
22
modules/hardware/misc/battery-power.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{ pkgs, ... }: {
|
||||
powerManagement.powertop.enable = true;
|
||||
|
||||
services = {
|
||||
udev.extraRules = ''
|
||||
#ACTION=="add", SUBSYSTEM=="usb", TEST=="power/control", ATTR{power/control}="auto"
|
||||
ACTION=="add", SUBSYSTEM=="pci", TEST=="power/control", ATTR{power/control}="auto"
|
||||
SUBSYSTEM=="power_supply", ACTION=="change", RUN+="${pkgs.writeShellScript "battery-thresholds" ''
|
||||
echo 80 > /sys/class/power_supply/BAT1/charge_control_start_threshold || true
|
||||
echo 85 > /sys/class/power_supply/BAT1/charge_control_end_threshold || true
|
||||
''}"
|
||||
'';
|
||||
upower = {
|
||||
enable = true;
|
||||
percentageCritical = 15;
|
||||
percentageAction = 10;
|
||||
usePercentageForPolicy = true;
|
||||
allowRiskyCriticalPowerAction = true;
|
||||
criticalPowerAction = "HybridSleep";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue