Restructure & rework power management config

This commit is contained in:
ItsDrike 2024-06-23 21:58:12 +02:00
parent 6545dda7f8
commit 08864662bb
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0
6 changed files with 47 additions and 74 deletions

View file

@ -1,37 +1,15 @@
{ pkgs, lib, config, ...}: let
inherit (lib) mkIf mkDefault;
inherit (lib) mkIf;
deviceType = config.myOptions.device.roles.type;
acceptedTypes = ["laptop"];
in {
imports = [
./auto-cpufreq
./power-profiles-daemon
./upower.nix
./acpi.nix
];
config = mkIf (builtins.elem deviceType acceptedTypes) {
hardware.acpilight.enable = true;
environment.systemPackages = with pkgs; [
acpi
powertop
];
services = {
# handle ACPI events
acpid.enable = true;
# temperature target on battery
undervolt = {
tempBat = 65; # deg C
package = pkgs.undervolt;
};
};
boot = {
kernelModules = ["acpi_call"];
extraModulePackages = with config.boot.kernelPackages; [
acpi_call
cpupower
];
};
environment.systemPackages = with pkgs; [ powertop ];
};
}