refactor: switch from modules to import arrays
This commit is contained in:
parent
d893750c09
commit
41eaa38d31
75 changed files with 1870 additions and 2541 deletions
|
|
@ -1,29 +1,19 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
feature = "tlp";
|
||||
in
|
||||
{
|
||||
config = lib.mkIf config.${feature}.enable {
|
||||
# Disable if devices take long to unsuspend (keyboard, mouse, etc)
|
||||
powerManagement.powertop.enable = true;
|
||||
services = {
|
||||
power-profiles-daemon.enable = false;
|
||||
tlp = {
|
||||
enable = true;
|
||||
settings = {
|
||||
# keep-sorted start
|
||||
CPU_BOOST_ON_AC = 1;
|
||||
CPU_BOOST_ON_BAT = 0;
|
||||
CPU_SCALING_GOVERNOR_ON_AC = "performance";
|
||||
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
|
||||
STOP_CHARGE_THRESH_BAT0 = 95;
|
||||
# keep-sorted end
|
||||
};
|
||||
# Disable if devices take long to unsuspend (keyboard, mouse, etc)
|
||||
powerManagement.powertop.enable = true;
|
||||
services = {
|
||||
power-profiles-daemon.enable = false;
|
||||
tlp = {
|
||||
enable = true;
|
||||
settings = {
|
||||
# keep-sorted start
|
||||
CPU_BOOST_ON_AC = 1;
|
||||
CPU_BOOST_ON_BAT = 0;
|
||||
CPU_SCALING_GOVERNOR_ON_AC = "performance";
|
||||
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
|
||||
STOP_CHARGE_THRESH_BAT0 = 95;
|
||||
# keep-sorted end
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
imports = [ ];
|
||||
|
||||
options.${feature}.enable = lib.mkEnableOption "enables ${feature}";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue