mirror of
https://github.com/NixOS/nixos-hardware.git
synced 2025-11-03 08:47:13 +08:00
replace tlp with power-profiles-daemon
TLP is often no longer the best choice since firmware provides power profiles instead. That's why we are removing TLP as the default option. We may want to bring back TLP to some old hardware if it makes sense i.e. certain thinkpad modules.
This commit is contained in:
@@ -14,8 +14,9 @@ For example:
|
||||
|
||||
```nix
|
||||
{ lib }: {
|
||||
# Using mkDefault, because the user might want to disable tlp
|
||||
services.tlp.enable = lib.mkDefault true;
|
||||
# Using mkDefault, because the user might want to disable power-profiles-daemon
|
||||
services.power-profiles-daemon.enable = lib.mkDefault true;
|
||||
|
||||
# No need to use mkDefault, because the setting will merge with the user's setting
|
||||
boot.kernelModules = [ "tmp_smapi" ];
|
||||
}
|
||||
|
||||
@@ -25,10 +25,6 @@
|
||||
lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8")
|
||||
[ "rtc_cmos.use_acpi_alarm=1" ];
|
||||
|
||||
# AMD has better battery life with PPD over TLP:
|
||||
# https://community.frame.work/t/responded-amd-7040-sleep-states/38101/13
|
||||
services.power-profiles-daemon.enable = lib.mkDefault true;
|
||||
|
||||
# Adds the missing asus functionality to Linux.
|
||||
# https://asus-linux.org/manual/asusctl-manual/
|
||||
services = {
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
{ lib, config, ... }: {
|
||||
imports = [ ../. ];
|
||||
|
||||
# Gnome 40 introduced a new way of managing power, without tlp.
|
||||
# However, these 2 services clash when enabled simultaneously.
|
||||
# https://github.com/NixOS/nixos-hardware/issues/260
|
||||
services.tlp.enable = lib.mkDefault (
|
||||
(lib.versionOlder (lib.versions.majorMinor lib.version) "21.05")
|
||||
|| !config.services.power-profiles-daemon.enable
|
||||
);
|
||||
config.services.power-profiles-daemon.enable = lib.mkDefault (!config.services.tlp.enable);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,3 @@
|
||||
`fwupd` is used to receive firmware updates from vendors. This device is in its [supported devices list](https://fwupd.org/lvfs/devices/)
|
||||
|
||||
`thermald` is used to achieve better thermal behaviour
|
||||
|
||||
##### TLP
|
||||
TLP is a battery power optimizer for laptops. It is enabled by default, however, since it conflicts with power-profiles-daemon which is GNOME's power management system, TLP will not be installed with if power-profiles-daemon or a recent version of GNOME is present.
|
||||
|
||||
@@ -19,8 +19,4 @@
|
||||
++ lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8") [
|
||||
"rtc_cmos.use_acpi_alarm=1"
|
||||
];
|
||||
|
||||
# AMD has better battery life with PPD over TLP:
|
||||
# https://community.frame.work/t/responded-amd-7040-sleep-states/38101/13
|
||||
services.power-profiles-daemon.enable = lib.mkDefault true;
|
||||
}
|
||||
|
||||
@@ -19,8 +19,4 @@
|
||||
++ lib.optionals (lib.versionOlder config.boot.kernelPackages.kernel.version "6.8") [
|
||||
"rtc_cmos.use_acpi_alarm=1"
|
||||
];
|
||||
|
||||
# AMD has better battery life with PPD over TLP:
|
||||
# https://community.frame.work/t/responded-amd-7040-sleep-states/38101/13
|
||||
services.power-profiles-daemon.enable = lib.mkDefault true;
|
||||
}
|
||||
|
||||
@@ -10,11 +10,6 @@
|
||||
"video=eDP-1:panel_orientation=right_side_up"
|
||||
];
|
||||
|
||||
services.tlp.enable = lib.mkDefault (
|
||||
(lib.versionOlder (lib.versions.majorMinor lib.version) "21.05")
|
||||
|| !config.services.power-profiles-daemon.enable
|
||||
);
|
||||
|
||||
# Required for grub to properly display the boot menu.
|
||||
boot.loader.grub.gfxmodeEfi = lib.mkDefault "720x1280x32";
|
||||
|
||||
|
||||
@@ -17,9 +17,4 @@
|
||||
|
||||
# Cooling management
|
||||
services.thermald.enable = lib.mkDefault true;
|
||||
|
||||
# tlp defaults to "powersave", which doesn't exist on this laptop
|
||||
services.tlp.settings = {
|
||||
CPU_SCALING_GOVERNOR_ON_BAT = "schedutil";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -32,8 +32,4 @@
|
||||
|
||||
# Avoid issues with modesetting causing blank screen
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
|
||||
# AMD has better battery life with PPD over TLP:
|
||||
# https://community.frame.work/t/responded-amd-7040-sleep-states/38101/13
|
||||
services.power-profiles-daemon.enable = lib.mkDefault true;
|
||||
}
|
||||
|
||||
@@ -110,9 +110,6 @@ in
|
||||
kernelParams = mkDefault [ "mem_sleep_default=deep" ];
|
||||
};
|
||||
|
||||
# NOTE: Check the README before enabling TLP:
|
||||
services.tlp.enable = mkDefault false;
|
||||
|
||||
# Needed for wifi firmware, see https://github.com/NixOS/nixos-hardware/issues/364
|
||||
hardware = {
|
||||
enableRedistributableFirmware = mkDefault true;
|
||||
|
||||
Reference in New Issue
Block a user