feat: big refactor
This commit is contained in:
parent
2c09c21833
commit
ebedec9768
159 changed files with 1927 additions and 2222 deletions
55
modules/core/power.nix
Normal file
55
modules/core/power.nix
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options.bchmnn = {
|
||||
|
||||
power = {
|
||||
tlp = {
|
||||
settings = lib.mkOption {
|
||||
type =
|
||||
with lib.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;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
powerManagement = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
services.tlp = {
|
||||
enable = !builtins.elem "gnome" config.bchmnn.gui.flavour;
|
||||
settings = config.bchmnn.power.tlp.settings;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [ powertop ];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue