mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-14 17:53:37 +00:00
6afb255d97
these changes were generated with nixq 0.0.2, by running nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix two mentions of the mdDoc function remain in nixos/, both of which are inside of comments. Since lib.mdDoc is already defined as just id, this commit is a no-op as far as Nix (and the built manual) is concerned.
81 lines
2.3 KiB
Nix
81 lines
2.3 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
cfg = config.services.auto-epp;
|
|
format = pkgs.formats.ini {};
|
|
|
|
inherit (lib) mkOption types;
|
|
in {
|
|
options = {
|
|
services.auto-epp = {
|
|
enable = lib.mkEnableOption "auto-epp for amd active pstate";
|
|
|
|
package = lib.mkPackageOptionMD pkgs "auto-epp" {};
|
|
|
|
settings = mkOption {
|
|
type = types.submodule {
|
|
freeformType = format.type;
|
|
options = {
|
|
Settings = {
|
|
epp_state_for_AC = mkOption {
|
|
type = types.str;
|
|
default = "balance_performance";
|
|
description = ''
|
|
energy_performance_preference when on plugged in
|
|
|
|
::: {.note}
|
|
See available epp states by running:
|
|
{command}`cat /sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences`
|
|
:::
|
|
'';
|
|
};
|
|
|
|
epp_state_for_BAT = mkOption {
|
|
type = types.str;
|
|
default = "power";
|
|
description = ''
|
|
`energy_performance_preference` when on battery
|
|
|
|
::: {.note}
|
|
See available epp states by running:
|
|
{command}`cat /sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences`
|
|
:::
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
};
|
|
default = {};
|
|
description = ''
|
|
Settings for the auto-epp application.
|
|
See upstream example: <https://github.com/jothi-prasath/auto-epp/blob/master/sample-auto-epp.conf>
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
boot.kernelParams = [
|
|
"amd_pstate=active"
|
|
];
|
|
|
|
environment.etc."auto-epp.conf".source = format.generate "auto-epp.conf" cfg.settings;
|
|
systemd.packages = [ cfg.package ];
|
|
|
|
systemd.services.auto-epp = {
|
|
after = [ "multi-user.target" ];
|
|
wantedBy = [ "multi-user.target" ];
|
|
description = "auto-epp - Automatic EPP Changer for amd-pstate-epp";
|
|
serviceConfig = {
|
|
Type = "simple";
|
|
User = "root";
|
|
ExecStart = lib.getExe cfg.package;
|
|
Restart = "on-failure";
|
|
};
|
|
};
|
|
};
|
|
|
|
meta.maintainers = with lib.maintainers; [ lamarios ];
|
|
}
|