bwa
This commit is contained in:
46
config/modules/power-management/intel-gpu-management.nix
Normal file
46
config/modules/power-management/intel-gpu-management.nix
Normal file
@@ -0,0 +1,46 @@
|
||||
{ den, modules, ... }:
|
||||
{
|
||||
# Intel Mobile Gpu Management
|
||||
modules.intel-mgm = {
|
||||
nixos =
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
batt-gpu = pkgs.writeShellScript "batt-igpu" ''
|
||||
${pkgs.intel-gpu-tools}/bin/intel_gpu_frequency -e
|
||||
echo "800" > /sys/class/drm/card1/gt_boost_freq_mhz
|
||||
'';
|
||||
ac-gpu = pkgs.writeShellScript "ac-igpu" ''
|
||||
${pkgs.intel-gpu-tools}/bin/intel_gpu_frequency -d
|
||||
echo "2350" > /sys/class/drm/card1/gt_boost_freq_mhz
|
||||
'';
|
||||
in
|
||||
{
|
||||
systemd.services.gpu-limit-on-batt = {
|
||||
enable = true;
|
||||
description = "Using rfkill; disable all rf devices before sleeping.";
|
||||
before = [ "battery.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${batt-gpu}";
|
||||
RemainAfterExit = true;
|
||||
};
|
||||
wantedBy = [ "battery.target" ];
|
||||
partOf = [ "battery.target" ];
|
||||
};
|
||||
systemd.services.gpu-limit-on-ac = {
|
||||
enable = true;
|
||||
description = "Using rfkill; disable all rf devices before sleeping.";
|
||||
before = [ "ac.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${ac-gpu}";
|
||||
RemainAfterExit = true;
|
||||
};
|
||||
wantedBy = [ "ac.target" ];
|
||||
partOf = [ "ac.target" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user