feat: add option for services.tlp.settings with defaults

This commit is contained in:
Jacob Bachmann 2024-09-05 18:39:46 +02:00
parent ad7f6bf039
commit 2c09c21833
Signed by: bchmnn
GPG key ID: 732A612DAD28067D
3 changed files with 48 additions and 6 deletions

View file

@ -11,6 +11,27 @@
bchmnn = { bchmnn = {
power = {
tlp = {
settings = {
# performance | powersave
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_SCALING_GOVERNOR_ON_BAT = "performance";
# performance | balance_performance | default | balance_power | power
CPU_ENERGY_PERF_POLICY_ON_AC = "power";
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
# performance | balanced | low-power
PLATFORM_PROFILE_ON_AC = "low-power";
PLATFORM_PROFILE_ON_BAT = "low-power";
CPU_MIN_PERF_ON_AC = 0;
CPU_MAX_PERF_ON_AC = 100;
CPU_MIN_PERF_ON_BAT = 0;
CPU_MAX_PERF_ON_BAT = 100;
};
};
};
gui = { gui = {
enable = true; enable = true;
greeter.enable = false; greeter.enable = false;
@ -35,4 +56,6 @@
}; };
services.logind.lidSwitch = "ignore";
} }

View file

@ -3,6 +3,30 @@
# options affecting multiple modules # options affecting multiple modules
options.bchmnn = with lib; { options.bchmnn = with lib; {
power = {
tlp = {
settings = mkOption {
type = with types; attrsOf (oneOf [ bool int float str (listOf str) ]);
default = {
# performance | powersave
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
# performance | balance_performance | default | balance_power | power
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
# performance | balanced | low-power
PLATFORM_PROFILE_ON_AC = "performance";
PLATFORM_PROFILE_ON_BAT = "low-power";
CPU_MIN_PERF_ON_AC = 0;
CPU_MAX_PERF_ON_AC = 100;
CPU_MIN_PERF_ON_BAT = 0;
CPU_MAX_PERF_ON_BAT = 100;
};
};
};
};
gui = { gui = {
enable = mkEnableOption "gui"; enable = mkEnableOption "gui";
greeter = { greeter = {

View file

@ -5,12 +5,7 @@
services.tlp = { services.tlp = {
enable = !builtins.elem "gnome" gui.flavour; enable = !builtins.elem "gnome" gui.flavour;
settings = { settings = power.tlp.settings;
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
CPU_ENERGY_PERF_POLICY_ON_BAT = "balance_power";
PLATFORM_PROFILE_ON_AC = "performance";
PLATFORM_PROFILE_ON_BAT = "balanced";
};
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [