mirror of
https://github.com/tomasriveral/nixos.git
synced 2026-08-12 02:28:37 +02:00
Corrected some bugs with waybar and added tlp
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
[ # Include the results of the hardware scan.
|
[ # Include the results of the hardware scan.
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
inputs.home-manager.nixosModules.default
|
inputs.home-manager.nixosModules.default
|
||||||
|
../../modules/nixos/battery.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
@@ -150,6 +151,7 @@ gcc # GNU C compiler
|
|||||||
libreoffice
|
libreoffice
|
||||||
gruvbox-gtk-theme
|
gruvbox-gtk-theme
|
||||||
hyprpicker
|
hyprpicker
|
||||||
|
power-profiles-daemon
|
||||||
#we need to install gnome and kde utils individually as we dont use gnome
|
#we need to install gnome and kde utils individually as we dont use gnome
|
||||||
gnome-calculator
|
gnome-calculator
|
||||||
snapshot
|
snapshot
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
transition-duration = 500;
|
transition-duration = 500;
|
||||||
transition-left-to-right = false;
|
transition-left-to-right = false;
|
||||||
};
|
};
|
||||||
items = [
|
modules = [
|
||||||
"pulseaudio"
|
"pulseaudio"
|
||||||
"pulseaudio#mic"
|
"pulseaudio#mic"
|
||||||
"pulseaudio/slider"
|
"pulseaudio/slider"
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
transition-duration = 500;
|
transition-duration = 500;
|
||||||
transition-left-to-right = true;
|
transition-left-to-right = true;
|
||||||
};
|
};
|
||||||
items = [
|
modules = [
|
||||||
"bluetooth"
|
"bluetooth"
|
||||||
"bluetooth#status"
|
"bluetooth#status"
|
||||||
];
|
];
|
||||||
@@ -57,18 +57,18 @@
|
|||||||
transition-duration = 500;
|
transition-duration = 500;
|
||||||
transition-left-to-right = false;
|
transition-left-to-right = false;
|
||||||
};
|
};
|
||||||
items = [
|
modules = [
|
||||||
"backlight"
|
"backlight"
|
||||||
"backlight/slider"
|
"backlight/slider"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
"group/connection" = {
|
"group/connection" = {
|
||||||
orientation = "inherit";
|
orientation = "inherit";
|
||||||
items = [ "group/network" ];
|
modules = [ "group/network" ];
|
||||||
};
|
};
|
||||||
"group/gcpu" = {
|
"group/gcpu" = {
|
||||||
orientation = "inherit";
|
orientation = "inherit";
|
||||||
items = [
|
modules = [
|
||||||
"custom/cpu-icon"
|
"custom/cpu-icon"
|
||||||
"temperature"
|
"temperature"
|
||||||
"cpu"
|
"cpu"
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
};
|
};
|
||||||
"group/info" = {
|
"group/info" = {
|
||||||
orientation = "inherit";
|
orientation = "inherit";
|
||||||
items = [
|
modules = [
|
||||||
"group/gcpu"
|
"group/gcpu"
|
||||||
"memory"
|
"memory"
|
||||||
"disk"
|
"disk"
|
||||||
@@ -88,7 +88,7 @@
|
|||||||
transition-duration = 500;
|
transition-duration = 500;
|
||||||
transition-left-to-right = true;
|
transition-left-to-right = true;
|
||||||
};
|
};
|
||||||
items = [
|
modules = [
|
||||||
"network"
|
"network"
|
||||||
"network#speed"
|
"network#speed"
|
||||||
];
|
];
|
||||||
@@ -99,21 +99,21 @@
|
|||||||
transition-duration = 500;
|
transition-duration = 500;
|
||||||
transition-left-to-right = false;
|
transition-left-to-right = false;
|
||||||
};
|
};
|
||||||
items = [
|
modules = [
|
||||||
"battery"
|
"battery"
|
||||||
"power-profiles-daemon"
|
"power-profiles-daemon"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
"group/sound" = {
|
"group/sound" = {
|
||||||
orientation = "inherit";
|
orientation = "inherit";
|
||||||
items = [
|
modules = [
|
||||||
"group/audio"
|
"group/audio"
|
||||||
"custom/notification"
|
"custom/notification"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
"group/together" = {
|
"group/together" = {
|
||||||
orientation = "inherit";
|
orientation = "inherit";
|
||||||
items = [
|
modules = [
|
||||||
"group/utils"
|
"group/utils"
|
||||||
"clock"
|
"clock"
|
||||||
];
|
];
|
||||||
@@ -124,7 +124,7 @@
|
|||||||
transition-duration = 500;
|
transition-duration = 500;
|
||||||
transition-left-to-right = true;
|
transition-left-to-right = true;
|
||||||
};
|
};
|
||||||
items = [
|
modules = [
|
||||||
"custom/weather"
|
"custom/weather"
|
||||||
"custom/colorpicker"
|
"custom/colorpicker"
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user