hardware/power.nix: init
This commit is contained in:
parent
cb504ad8ca
commit
cfefe9bbe1
2 changed files with 76 additions and 1 deletions
|
@ -1,5 +1,10 @@
|
|||
_: {
|
||||
imports = [./bluetooth.nix ./keyboard ./graphics.nix];
|
||||
imports = [
|
||||
./bluetooth.nix
|
||||
./keyboard
|
||||
./graphics.nix
|
||||
./power.nix
|
||||
];
|
||||
|
||||
services.irqbalance.enable = true;
|
||||
}
|
||||
|
|
70
modules/system/hardware/power.nix
Normal file
70
modules/system/hardware/power.nix
Normal file
|
@ -0,0 +1,70 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkDefault;
|
||||
in {
|
||||
config = {
|
||||
environment.systemPackages = builtins.attrValues {
|
||||
inherit
|
||||
(pkgs)
|
||||
acpi
|
||||
powertop
|
||||
;
|
||||
};
|
||||
|
||||
boot = {
|
||||
kernelModules = ["acpi_call"];
|
||||
extraModulePackages = with config.boot.kernelPackages; [
|
||||
acpi_call
|
||||
cpupower
|
||||
];
|
||||
};
|
||||
|
||||
hardware.acpilight.enable = false;
|
||||
|
||||
services = {
|
||||
upower = {
|
||||
enable = true;
|
||||
percentageLow = 15;
|
||||
percentageCritical = 5;
|
||||
};
|
||||
|
||||
acpid = {
|
||||
enable = true;
|
||||
logEvents = true;
|
||||
};
|
||||
|
||||
# INFO: Only works on Intel
|
||||
undervolt = {
|
||||
enable = true;
|
||||
|
||||
tempBat = 65;
|
||||
package = pkgs.undervolt;
|
||||
};
|
||||
|
||||
auto-cpufreq = {
|
||||
enable = true;
|
||||
settings = {
|
||||
charger = {
|
||||
governor = "performance";
|
||||
energy_performance_preference = "performance";
|
||||
scaling_min_freq = mkDefault 1800000;
|
||||
scaling_max_freq = mkDefault 3800000;
|
||||
turbo = "auto";
|
||||
};
|
||||
|
||||
battery = {
|
||||
governor = "powersave";
|
||||
energy_performance_preference = "power";
|
||||
scaling_min_freq = mkDefault 1200000;
|
||||
scaling_max_freq = mkDefault 1800000;
|
||||
turbo = "never";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue