laptop: check for tuned service before enabling tlp #1630
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of changes
This PR adds an extra check to the logic that conditionally enabled
tlp
on laptops by default. Before, it was enabled ifpower-profiles-daemon
.With this change, we also check for
services.tuned.enable
, which also conflicts withtlp
. Enablingtuned
and loading the default laptop module resulted in an evaluation error of the config.I have a couple of questions regarding the changes:
auto-cpufreq
also conflicts with the service. Should we add a check for it as well?lib.version
check before accessing thepower-profiles-daemon
to avoid evaluation error in older NixOS releases (pc/laptop: fix evaluation on 20.09 #270). I replaced that with an existence check for both options for consistency, but I can revert that part (tuned
was released in 25.05 I believe).In the end, this PR is superseded by #1474, but it is a nice QOL improvement while it doesn't land.
Things done
nixos-hardware
andimporting it via
<nixos-hardware>
or Flake input