mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-24 10:56:56 +00:00
3141185a3b
Co-authored-by: Aamaruvi Yogamani <38222826+Technical27@users.noreply.github.com>
40 lines
1.1 KiB
Nix
40 lines
1.1 KiB
Nix
{ lib, python3Packages, fetchFromGitHub }:
|
|
|
|
python3Packages.buildPythonPackage rec {
|
|
pname = "auto-cpufreq";
|
|
version = "1.6.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "AdnanHodzic";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
sha256 = "sha256-oz3C1150CPfT0kkx1x7VIX/Rm06dkjyxeDPFCRJaWNc=";
|
|
};
|
|
|
|
propagatedBuildInputs = with python3Packages; [ click distro psutil ];
|
|
|
|
doCheck = false;
|
|
pythonImportsCheck = [ "auto_cpufreq" ];
|
|
|
|
# patch to prevent script copying and to disable install
|
|
patches = [ ./prevent-install-and-copy.patch ];
|
|
|
|
postInstall = ''
|
|
# copy script manually
|
|
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
|
|
'';
|
|
|
|
meta = with lib; {
|
|
homepage = "https://github.com/AdnanHodzic/auto-cpufreq";
|
|
description = "Automatic CPU speed & power optimizer for Linux";
|
|
license = licenses.lgpl3Plus;
|
|
platforms = platforms.linux;
|
|
maintainers = [ maintainers.Technical27 ];
|
|
};
|
|
}
|