From d28d2a249455cd1b3b59db23ba7ae62c1d550279 Mon Sep 17 00:00:00 2001 From: Konrad Borowski Date: Mon, 3 Apr 2023 09:18:09 +0200 Subject: [PATCH] Load acpi_call module only if tlp is being used power-profiles-daemon cannot use acpi_call. This avoids taining the kernel by installing an unnecessary kernel module. --- common/pc/laptop/acpi_call.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/pc/laptop/acpi_call.nix b/common/pc/laptop/acpi_call.nix index f8c17dc..76e4b27 100644 --- a/common/pc/laptop/acpi_call.nix +++ b/common/pc/laptop/acpi_call.nix @@ -1,9 +1,9 @@ # acpi_call makes tlp work for newer thinkpads -{ config, ... }: +{ config, lib, ... }: { - boot = { + boot = lib.mkIf config.services.tlp.enable { kernelModules = [ "acpi_call" ]; extraModulePackages = with config.boot.kernelPackages; [ acpi_call ]; };