Finished TLP config

This commit is contained in:
Tomas Rivera
2026-02-28 10:23:51 +01:00
parent 4e547fd74a
commit 25e3032ff6
2 changed files with 21 additions and 20 deletions
-1
View File
@@ -151,7 +151,6 @@ gcc # GNU C compiler
libreoffice
gruvbox-gtk-theme
hyprpicker
power-profiles-daemon
#we need to install gnome and kde utils individually as we dont use gnome
gnome-calculator
snapshot
+21 -19
View File
@@ -1,26 +1,28 @@
# https://discourse.nixos.org/t/what-is-the-best-option-for-power-management/63406/2
{
config,
lib,
vars,
...
}: let
cfg = config.custom;
hasBattery =
lib.any (x: lib.strings.hasPrefix "BAT" x)
(builtins.attrNames (builtins.readDir "/sys/class/power_supply"));
in {
options.custom = {
battery.enable = lib.mkOption {
default = hasBattery;
description = "Enable better battery support";
type = lib.types.bool;
};
};
}:
config = lib.mkIf cfg.battery.enable {
# we just activate tlp unconditonally
#let
# cfg = config.custom;
#hasBattery =
# lib.any (x: lib.strings.hasPrefix "BAT" x)
# (builtins.attrNames (builtins.readDir "/sys/class/power_supply"));
#in
{
# options.custom = {
# battery.enable = lib.mkOption {
# default = hasBattery;
# description = "Enable better battery support";
# type = lib.types.bool;
# };
# };
# config = lib.mkIf cfg.battery.enable {
powerManagement.powertop.enable = true; # enable powertop auto tuning on startup.
services.system76-scheduler.settings.cfsProfiles.enable = true; # Better scheduling for CPU cycles - thanks System76!!!
services.thermald.enable = true; # Enable thermald, the temperature management daemon. (only necessary if on Intel CPUs)
services.power-profiles-daemon.enable = false; # Disable GNOMEs power management
@@ -41,5 +43,5 @@ in {
STOP_CHARGE_THRESH_BAT0 = 81;
};
};
};
# };
}