This repository has been archived on 2023-08-08. You can view files and clone it, but cannot push or open issues or pull requests.
nil/modules/system/power.nix

19 lines
489 B
Nix
Raw Normal View History

2022-03-24 22:04:31 +00:00
{ config, lib, pkgs, ... }:
2022-08-14 02:42:16 +00:00
let this = config.my.system.power;
2022-03-24 22:04:31 +00:00
in with lib; {
2022-08-14 02:42:04 +00:00
options.my.system.power.enable = mkEnableOption "Power Management";
2022-03-24 22:04:31 +00:00
2022-08-14 02:42:16 +00:00
config = mkIf this.enable {
2022-03-24 22:04:31 +00:00
# fan control modules
boot.extraModprobeConfig = ''
options thinkpad_acpi fan_control=1 experimental=1
'';
# battery optimizations
powerManagement.powertop.enable = true;
services.upower.enable = true;
environment.systemPackages = with pkgs; [ powertop tpacpi-bat ];
2022-03-24 22:04:31 +00:00
};
}