Corrected some bugs with waybar and added tlp

This commit is contained in:
Tomas Rivera
2026-02-28 10:05:53 +01:00
parent d72357ed3e
commit 4e547fd74a
3 changed files with 58 additions and 11 deletions
+2
View File
@@ -9,6 +9,7 @@
[ # Include the results of the hardware scan.
./hardware-configuration.nix
inputs.home-manager.nixosModules.default
../../modules/nixos/battery.nix
];
@@ -150,6 +151,7 @@ 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
+11 -11
View File
@@ -34,7 +34,7 @@
transition-duration = 500;
transition-left-to-right = false;
};
items = [
modules = [
"pulseaudio"
"pulseaudio#mic"
"pulseaudio/slider"
@@ -46,7 +46,7 @@
transition-duration = 500;
transition-left-to-right = true;
};
items = [
modules = [
"bluetooth"
"bluetooth#status"
];
@@ -57,18 +57,18 @@
transition-duration = 500;
transition-left-to-right = false;
};
items = [
modules = [
"backlight"
"backlight/slider"
];
};
"group/connection" = {
orientation = "inherit";
items = [ "group/network" ];
modules = [ "group/network" ];
};
"group/gcpu" = {
orientation = "inherit";
items = [
modules = [
"custom/cpu-icon"
"temperature"
"cpu"
@@ -76,7 +76,7 @@
};
"group/info" = {
orientation = "inherit";
items = [
modules = [
"group/gcpu"
"memory"
"disk"
@@ -88,7 +88,7 @@
transition-duration = 500;
transition-left-to-right = true;
};
items = [
modules = [
"network"
"network#speed"
];
@@ -99,21 +99,21 @@
transition-duration = 500;
transition-left-to-right = false;
};
items = [
modules = [
"battery"
"power-profiles-daemon"
];
};
"group/sound" = {
orientation = "inherit";
items = [
modules = [
"group/audio"
"custom/notification"
];
};
"group/together" = {
orientation = "inherit";
items = [
modules = [
"group/utils"
"clock"
];
@@ -124,7 +124,7 @@
transition-duration = 500;
transition-left-to-right = true;
};
items = [
modules = [
"custom/weather"
"custom/colorpicker"
];
+45
View File
@@ -0,0 +1,45 @@
# 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 {
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
services.tlp = {
enable = true; # Enable TLP (better than gnomes internal power manager)
settings = {
CPU_BOOST_ON_AC = 1;
CPU_BOOST_ON_BAT = 1;
CPU_HWP_DYN_BOOST_ON_AC = 1;
CPU_HWP_DYN_BOOST_ON_BAT = 1;
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_power";
PLATFORM_PROFILE_ON_AC = "performance";
PLATFORM_PROFILE_ON_BAT = "balanced";
START_CHARGE_THRESH_BAT0 = 75;
STOP_CHARGE_THRESH_BAT0 = 81;
};
};
};
}