44 lines
1.3 KiB
Nix
44 lines
1.3 KiB
Nix
|
{ pkgs, config, lib, system, ... }:
|
||
|
let
|
||
|
cfg = config.grimmShared;
|
||
|
perf_policy = lib.optional (lib.systems.elaborate system).isx86 config.boot.kernelPackages.x86_energy_perf_policy;
|
||
|
in
|
||
|
{
|
||
|
config = with cfg; lib.mkIf (enable && laptop_hardware.enable) {
|
||
|
environment.systemPackages = with pkgs; [
|
||
|
acpi
|
||
|
powertop
|
||
|
] ++ lib.optionals graphical [
|
||
|
tlpui
|
||
|
] ++ perf_policy;
|
||
|
|
||
|
powerManagement.scsiLinkPolicy = lib.mkIf (!config.services.tlp.enable) "min_power";
|
||
|
powerManagement.cpuFreqGovernor = lib.mkDefault "normal";
|
||
|
|
||
|
services.power-profiles-daemon.enable = false;
|
||
|
services.upower.enable = true;
|
||
|
boot.extraModulePackages = perf_policy;
|
||
|
|
||
|
services.tlp = {
|
||
|
enable = true;
|
||
|
settings = {
|
||
|
USB_AUTOSUSPEND = 1;
|
||
|
USB_EXCLUDE_BTUSB = 1;
|
||
|
USB_EXCLUDE_PHONE = 1;
|
||
|
SOUND_POWER_SAVE_ON_AC = 0;
|
||
|
SOUND_POWER_SAVE_ON_BAT = 1;
|
||
|
SATA_LINKPWR_ON_AC = "max_performance";
|
||
|
SATA_LINKPWR_ON_BAT = "min_power";
|
||
|
MAX_LOST_WORK_SECS_ON_BAT = 15;
|
||
|
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
|
||
|
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
|
||
|
CPU_BOOST_ON_AC = 1;
|
||
|
CPU_BOOST_ON_BAT = 0;
|
||
|
RUNTIME_PM_ON_AC = "on";
|
||
|
RUNTIME_PM_ON_BAT = "auto";
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
}
|
||
|
|