From 111d7c3baa2973b55a0455a44f4e21bfc3673ffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Tri=C3=B1anes?= Date: Sun, 5 Oct 2025 17:43:21 +0200 Subject: [PATCH] laptop: check for tuned service before enabling tlp --- common/pc/laptop/default.nix | 11 ++++++++--- gpd/win-2/default.nix | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/common/pc/laptop/default.nix b/common/pc/laptop/default.nix index abc76fa7e..03cee4a27 100644 --- a/common/pc/laptop/default.nix +++ b/common/pc/laptop/default.nix @@ -1,4 +1,9 @@ -{ config, lib, ... }: +{ + config, + lib, + options, + ... +}: { imports = [ ../. ]; @@ -7,7 +12,7 @@ # 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 + !(options.services ? power-profiles-daemon && config.services.power-profiles-daemon.enable) + && !(options.services ? tuned && config.services.tuned.enable) ); } diff --git a/gpd/win-2/default.nix b/gpd/win-2/default.nix index e7247534d..35c1ce563 100644 --- a/gpd/win-2/default.nix +++ b/gpd/win-2/default.nix @@ -1,4 +1,9 @@ -{ config, lib, ... }: +{ + config, + lib, + options, + ... +}: { imports = [ ../../common/cpu/intel @@ -11,8 +16,8 @@ ]; services.tlp.enable = lib.mkDefault ( - (lib.versionOlder (lib.versions.majorMinor lib.version) "21.05") - || !config.services.power-profiles-daemon.enable + !(options.services ? power-profiles-daemon && config.services.power-profiles-daemon.enable) + && !(options.services ? tuned && config.services.tuned.enable) ); # Required for grub to properly display the boot menu.