9 cfg = config.services.auto-epp;
10 format = pkgs.formats.ini { };
12 inherit (lib) mkOption types;
17 enable = lib.mkEnableOption "auto-epp for amd active pstate";
19 package = lib.mkPackageOption pkgs "auto-epp" { };
22 type = types.submodule {
23 freeformType = format.type;
26 epp_state_for_AC = mkOption {
28 default = "balance_performance";
30 energy_performance_preference when on plugged in
33 See available epp states by running:
34 {command}`cat /sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences`
39 epp_state_for_BAT = mkOption {
43 `energy_performance_preference` when on battery
46 See available epp states by running:
47 {command}`cat /sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences`
56 Settings for the auto-epp application.
57 See upstream example: <https://github.com/jothi-prasath/auto-epp/blob/master/sample-auto-epp.conf>
63 config = lib.mkIf cfg.enable {
69 environment.etc."auto-epp.conf".source = format.generate "auto-epp.conf" cfg.settings;
70 systemd.packages = [ cfg.package ];
72 systemd.services.auto-epp = {
73 after = [ "multi-user.target" ];
74 wantedBy = [ "multi-user.target" ];
75 description = "auto-epp - Automatic EPP Changer for amd-pstate-epp";
79 ExecStart = lib.getExe cfg.package;
80 Restart = "on-failure";
85 meta.maintainers = with lib.maintainers; [ lamarios ];