1
0
Fork 0
mirror of https://git.sr.ht/~neverness/ultima synced 2024-12-29 18:43:52 +00:00
ultima/modules/nixos/services/tlp/default.nix

71 lines
1.5 KiB
Nix
Raw Permalink Normal View History

{
x,
pkgs,
lib,
config,
...
}:
2024-11-21 09:24:15 +00:00
with lib;
2024-12-09 01:15:55 +00:00
with x;
let
cfg = config.module.services.tlp;
in
{
options = {
module.services.tlp = {
enable = mkBool;
};
};
2024-11-21 09:24:15 +00:00
config = mkIf cfg.enable {
services = {
thermald = True;
upower = True;
fprintd = True // {
# FINGER PRINT
2024-11-21 09:24:15 +00:00
package = pkgs.fprintd-tod;
tod = True // {
driver = pkgs.libfprint-2-tod1-vfs0090;
};
2024-11-21 09:24:15 +00:00
};
tlp = True // {
settings = {
PLATFORM_PROFILE_ON_AC = "performance";
PLATFORM_PROFILE_ON_BAT = "balanced";
# CPU
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
CPU_ENERGY_PERF_POLICY_ON_BAT = "balance_performance";
CPU_BOOST_ON_AC = 1;
CPU_BOOST_ON_BAT = 0;
CPU_MIN_PERF_ON_AC = 0;
CPU_MAX_PERF_ON_AC = 100;
CPU_MIN_PERF_ON_BAT = 0;
CPU_MAX_PERF_ON_BAT = 40;
# NETWORKING
WIFI_PWR_ON_AC = "off";
WIFI_PWR_ON_BAT = "on";
# GRAPHICS
RADEON_DPM_STATE_ON_AC = "performance";
RADEON_DPM_STATE_ON_BAT = "battery";
RADEON_POWER_PROFILE_ON_AC = "default";
RADEON_POWER_PROFILE_ON_BAT = "default";
# IDK
TLP_DEFAULT_MODE = "BAT";
RUNTIME_PM_ON_AC = "auto";
RUNTIME_PM_ON_BAT = "auto";
USB_AUTOSUSPEND = 0;
};
};
};
};
}