2024-05-04 23:15:57 +03:00
|
|
|
# Disable CPU boost after boot. Control with `powersave` script.
|
2024-05-06 19:34:00 +03:00
|
|
|
{ lib, pkgs, controlFile, enable, disable, ... }: {
|
|
|
|
systemd = {
|
|
|
|
services.powersave = {
|
|
|
|
description = "Disable CPU Boost";
|
|
|
|
enable = true;
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "simple";
|
|
|
|
RemainAfterExit = "yes";
|
|
|
|
ExecStart = "${lib.getExe pkgs.bash} -c 'echo ${enable} > ${controlFile}'";
|
|
|
|
ExecStop = "${lib.getExe pkgs.bash} -c 'echo ${disable} > ${controlFile}'";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-05-06 22:30:55 +03:00
|
|
|
# HACK: Allow user access.
|
2024-05-06 19:34:00 +03:00
|
|
|
tmpfiles.rules = [ "z ${controlFile} 0777 - - - -" ];
|
|
|
|
};
|
|
|
|
}
|