mirror of
https://github.com/ItsDrike/nixdots
synced 2025-06-30 18:10:43 +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
19
system/roles/laptop/power/upower.nix
Normal file
19
system/roles/laptop/power/upower.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue