NixOS-Configs/hosts/workstation/auto-cpufreq.nix
2025-08-31 15:13:01 -05:00

26 lines
582 B
Nix

{ pkgs, inputs, config, lib, ... }:
with lib;
let cfg = config.roles.auto-cpufreq;
in {
options.roles.auto-cpufreq = {
enable = mkEnableOption "roles auto-cpufreq";
};
config = mkIf cfg.enable {
services.auto-cpufreq = {
enable = true;
settings = {
battery = {
governor = "powersave";
turbo = "never";
enable_thresholds = true;
start_threshold = 50;
stop_threshold = 80;
};
charger = {
governor = "performance";
turbo = "auto";
};
};
};
};
}