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";
|
||||
};
|
||||
};
|
||||
}
|
||||
30
modules/hardware/misc/cpu-thermal.nix
Normal file
30
modules/hardware/misc/cpu-thermal.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{ ... }: {
|
||||
services = {
|
||||
thermald.enable = true;
|
||||
throttled.enable = true;
|
||||
auto-cpufreq = {
|
||||
enable = true;
|
||||
settings = {
|
||||
charger = {
|
||||
governor = "performance";
|
||||
energy_performance_preference = "balance_performance";
|
||||
turbo = "auto";
|
||||
};
|
||||
battery = {
|
||||
governor = "powersave";
|
||||
energy_performance_preference = "balance_power";
|
||||
turbo = "never";
|
||||
};
|
||||
};
|
||||
};
|
||||
thinkfan = {
|
||||
enable = true;
|
||||
levels = [
|
||||
[ "level auto" 0 55 ]
|
||||
[ 3 55 65 ]
|
||||
[ 7 65 75 ]
|
||||
[ "level full-speed" 75 100 ]
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
6
modules/hardware/misc/power-button.nix
Normal file
6
modules/hardware/misc/power-button.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ ... }: {
|
||||
services.logind.settings.Login = {
|
||||
HandleLidSwitch = "suspend";
|
||||
HandlePowerKey = "ignore";
|
||||
};
|
||||
}
|
||||
7
modules/hardware/misc/tzupdate.nix
Normal file
7
modules/hardware/misc/tzupdate.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{ lib, ... }: {
|
||||
time.timeZone = lib.mkForce null;
|
||||
services.tzupdate = {
|
||||
enable = true;
|
||||
timer.enable = true;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue