updated modules to work for cloud
This commit is contained in:
@ -1,15 +1,13 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
# Define a more flexible power management module
|
||||
cfg = config.pwrMgnt;
|
||||
cfg = config.pwrMgmt;
|
||||
in {
|
||||
# Define options for customizable power management
|
||||
options.pwrMgnt = {
|
||||
options.pwrMgmt = {
|
||||
enable = lib.mkEnableOption "Custom power management configuration";
|
||||
|
||||
cpuFreqGovernor = lib.mkOption {
|
||||
type = lib.types.enum [
|
||||
"performance"
|
||||
@ -21,7 +19,6 @@ in {
|
||||
description = "CPU frequency scaling governor to use";
|
||||
};
|
||||
|
||||
# PowerTop Configuration
|
||||
powertop = {
|
||||
enable = lib.mkEnableOption "PowerTop power management tool";
|
||||
|
||||
@ -32,7 +29,6 @@ in {
|
||||
};
|
||||
};
|
||||
|
||||
# Battery-specific settings (for laptops)
|
||||
battery = {
|
||||
enable = lib.mkEnableOption "Battery-specific power management";
|
||||
|
||||
@ -56,7 +52,7 @@ in {
|
||||
cpuFreqGovernor = cfg.cpuFreqGovernor;
|
||||
};
|
||||
|
||||
services.powertop.enable = cfg.powertop.enable;
|
||||
environment.systemPackages = lib.mkIf cfg.powertop.enable [pkgs.powertop];
|
||||
systemd.services.battery-charge-threshold = lib.mkIf cfg.battery.enable {
|
||||
description = "Set battery charge thresholds";
|
||||
wantedBy = ["multi-user.target"];
|
||||
|
Reference in New Issue
Block a user