mirror of
https://github.com/ItsDrike/nixdots
synced 2025-06-30 21:00:42 +00:00
Restructure & rework power management config
This commit is contained in:
parent
6545dda7f8
commit
08864662bb
6 changed files with 47 additions and 74 deletions
23
system/roles/laptop/power/acpi.nix
Normal file
23
system/roles/laptop/power/acpi.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{ pkgs, lib, config, ...}: let
|
||||
inherit (lib) mkIf;
|
||||
deviceType = config.myOptions.device.roles.type;
|
||||
acceptedTypes = ["laptop"];
|
||||
in {
|
||||
config = mkIf (builtins.elem deviceType acceptedTypes) {
|
||||
hardware.acpilight.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [ acpi ];
|
||||
|
||||
# handle ACPI events
|
||||
services.acpid.enable = true;
|
||||
|
||||
boot = {
|
||||
kernelModules = ["acpi_call"];
|
||||
extraModulePackages = with config.boot.kernelPackages; [
|
||||
acpi_call
|
||||
cpupower
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue