2021-02-05 17:12:51 +00:00
|
|
|
{ lib, python3Packages, fetchFromGitHub }:
|
2021-01-09 10:05:03 +00:00
|
|
|
|
|
|
|
python3Packages.buildPythonPackage rec {
|
|
|
|
pname = "auto-cpufreq";
|
2021-06-28 23:13:55 +00:00
|
|
|
version = "1.6.4";
|
2021-01-09 10:05:03 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "AdnanHodzic";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-06-28 23:13:55 +00:00
|
|
|
sha256 = "sha256-9WYuAWcJGosYEsnnkqvZLXXvqF+1nBEozh6F84Kit6w=";
|
2021-01-09 10:05:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3Packages; [ click distro psutil ];
|
|
|
|
|
|
|
|
doCheck = false;
|
2021-02-05 17:12:51 +00:00
|
|
|
pythonImportsCheck = [ "auto_cpufreq" ];
|
2021-01-09 10:05:03 +00:00
|
|
|
|
|
|
|
# patch to prevent script copying and to disable install
|
|
|
|
patches = [ ./prevent-install-and-copy.patch ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# copy script manually
|
2021-02-05 17:12:51 +00:00
|
|
|
cp ${src}/scripts/cpufreqctl.sh $out/bin/cpufreqctl.auto-cpufreq
|
|
|
|
|
|
|
|
# systemd service
|
|
|
|
mkdir -p $out/lib/systemd/system
|
|
|
|
cp ${src}/scripts/auto-cpufreq.service $out/lib/systemd/system
|
|
|
|
substituteInPlace $out/lib/systemd/system/auto-cpufreq.service --replace "/usr/local" $out
|
2021-01-09 10:05:03 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2021-01-09 10:05:03 +00:00
|
|
|
homepage = "https://github.com/AdnanHodzic/auto-cpufreq";
|
|
|
|
description = "Automatic CPU speed & power optimizer for Linux";
|
|
|
|
license = licenses.lgpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.Technical27 ];
|
|
|
|
};
|
|
|
|
}
|