{ config, pkgs, lib, ... }: let cfg = config.ctucxConfig.configure.mobileDevice; in { options = { ctucxConfig.configure.mobileDevice = lib.mkEnableOption "mobile device"; }; config = lib.mkIf cfg { powerManagement = { enable = true; cpuFreqGovernor = lib.mkDefault "powersave"; }; services = { upower.enable = true; # throttled.enable = true; logind.lidSwitch = "lock"; logind.extraConfig = "HandlePowerKey=suspend"; tlp = { enable = true; settings = { CPU_SCALING_GOVERNOR_ON_AC = "performance"; CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; START_CHARGE_THRESH_BAT0 = 95; STOP_CHARGE_THRESH_BAT0 = 100; CPU_SCALING_MIN_FREQ_ON_AC = 800000; CPU_SCALING_MAX_FREQ_ON_AC = 3000000; CPU_SCALING_MIN_FREQ_ON_BAT = 800000; CPU_SCALING_MAX_FREQ_ON_BAT = 2000000; SOUND_POWER_SAVE_ON_AC = 0; SOUND_POWER_SAVE_ON_BAT = 1; RUNTIME_PM_ON_AC = "on"; RUNTIME_PM_ON_BAT = "auto"; NATACPI_ENABLE = 1; TPACPI_ENABLE = 1; TPSMAPI_ENABLE = 1; }; }; }; }; }