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

@ -0,0 +1,19 @@
{ pkgs, lib, config, ...}: let
inherit (lib) mkIf;
deviceType = config.myOptions.device.roles.type;
acceptedTypes = ["laptop"];
in {
config = mkIf (builtins.elem deviceType acceptedTypes) {
services = {
# DBus service that provides power management support to applications
upower = {
enable = true;
percentageLow = 15;
percentageCritical = 5;
percentageAction = 3;
criticalPowerAction = "Hibernate";
};
};
};
}