Skip to content

laptop: replace tlp with power-profiles-daemon #1474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" ];
}
Expand Down
4 changes: 0 additions & 4 deletions asus/fa507nv/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
12 changes: 2 additions & 10 deletions common/pc/laptop/default.nix
Original file line number Diff line number Diff line change
@@ -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);
}
3 changes: 0 additions & 3 deletions dell/inspiron/14-5420/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
4 changes: 0 additions & 4 deletions framework/13-inch/common/amd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
4 changes: 0 additions & 4 deletions framework/16-inch/common/amd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
5 changes: 0 additions & 5 deletions gpd/win-2/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
5 changes: 0 additions & 5 deletions lenovo/ideapad/15arh05/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
};
}
4 changes: 0 additions & 4 deletions lenovo/legion/16aph8/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
3 changes: 0 additions & 3 deletions microsoft/surface/common/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading