From e60c66bd0b6a4a9404644020bbeaa1d759d13c3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sun, 11 May 2025 09:56:29 +0200 Subject: [PATCH] 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. --- CONTRIBUTING.md | 5 +++-- asus/fa507nv/default.nix | 4 ---- common/pc/laptop/default.nix | 11 ++--------- dell/inspiron/14-5420/README.md | 3 --- framework/13-inch/common/amd.nix | 4 ---- framework/16-inch/common/amd.nix | 4 ---- gpd/win-2/default.nix | 5 ----- lenovo/ideapad/15arh05/default.nix | 5 ----- lenovo/legion/16aph8/default.nix | 4 ---- microsoft/surface/common/default.nix | 3 --- 10 files changed, 5 insertions(+), 43 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 93564142..d650a8e1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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" ]; } diff --git a/asus/fa507nv/default.nix b/asus/fa507nv/default.nix index 43ff7133..8594bc55 100644 --- a/asus/fa507nv/default.nix +++ b/asus/fa507nv/default.nix @@ -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 = { diff --git a/common/pc/laptop/default.nix b/common/pc/laptop/default.nix index abc76fa7..e9aaf03e 100644 --- a/common/pc/laptop/default.nix +++ b/common/pc/laptop/default.nix @@ -1,13 +1,6 @@ -{ 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); } diff --git a/dell/inspiron/14-5420/README.md b/dell/inspiron/14-5420/README.md index a7c5c06b..b75106a6 100644 --- a/dell/inspiron/14-5420/README.md +++ b/dell/inspiron/14-5420/README.md @@ -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. diff --git a/framework/13-inch/common/amd.nix b/framework/13-inch/common/amd.nix index 4a89f8da..78ad108c 100644 --- a/framework/13-inch/common/amd.nix +++ b/framework/13-inch/common/amd.nix @@ -18,8 +18,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; } diff --git a/framework/16-inch/common/amd.nix b/framework/16-inch/common/amd.nix index 4a89f8da..78ad108c 100644 --- a/framework/16-inch/common/amd.nix +++ b/framework/16-inch/common/amd.nix @@ -18,8 +18,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; } diff --git a/gpd/win-2/default.nix b/gpd/win-2/default.nix index e7247534..3a773219 100644 --- a/gpd/win-2/default.nix +++ b/gpd/win-2/default.nix @@ -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"; diff --git a/lenovo/ideapad/15arh05/default.nix b/lenovo/ideapad/15arh05/default.nix index a4ff8df1..e13e0608 100644 --- a/lenovo/ideapad/15arh05/default.nix +++ b/lenovo/ideapad/15arh05/default.nix @@ -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"; - }; } diff --git a/lenovo/legion/16aph8/default.nix b/lenovo/legion/16aph8/default.nix index 5771d65b..c131658e 100644 --- a/lenovo/legion/16aph8/default.nix +++ b/lenovo/legion/16aph8/default.nix @@ -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; } diff --git a/microsoft/surface/common/default.nix b/microsoft/surface/common/default.nix index 1fe46fee..3d77f310 100644 --- a/microsoft/surface/common/default.nix +++ b/microsoft/surface/common/default.nix @@ -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;