1 { config, lib, pkgs, ... }:
4 cfg = config.services.auto-epp;
5 format = pkgs.formats.ini {};
7 inherit (lib) mkOption types;
11 enable = lib.mkEnableOption "auto-epp for amd active pstate";
13 package = lib.mkPackageOption pkgs "auto-epp" {};
16 type = types.submodule {
17 freeformType = format.type;
20 epp_state_for_AC = mkOption {
22 default = "balance_performance";
24 energy_performance_preference when on plugged in
27 See available epp states by running:
28 {command}`cat /sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences`
33 epp_state_for_BAT = mkOption {
37 `energy_performance_preference` when on battery
40 See available epp states by running:
41 {command}`cat /sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences`
50 Settings for the auto-epp application.
51 See upstream example: <https://github.com/jothi-prasath/auto-epp/blob/master/sample-auto-epp.conf>
57 config = lib.mkIf cfg.enable {
63 environment.etc."auto-epp.conf".source = format.generate "auto-epp.conf" cfg.settings;
64 systemd.packages = [ cfg.package ];
66 systemd.services.auto-epp = {
67 after = [ "multi-user.target" ];
68 wantedBy = [ "multi-user.target" ];
69 description = "auto-epp - Automatic EPP Changer for amd-pstate-epp";
73 ExecStart = lib.getExe cfg.package;
74 Restart = "on-failure";
79 meta.maintainers = with lib.maintainers; [ lamarios ];