2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, perl, kmod, coreutils }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Requires the acpi_call kernel module in order to run.
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "tpacpi-bat";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "3.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "teleshoes";
|
|
|
|
repo = "tpacpi-bat";
|
|
|
|
rev = "v${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
sha256 = "sha256-9XnvVNdgB5VeI3juZfc8N5weEyULXuqu1IDChZfQqFk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ perl ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp tpacpi-bat $out/bin
|
|
|
|
'';
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace tpacpi-bat \
|
|
|
|
--replace modprobe ${kmod}/bin/modprobe \
|
|
|
|
--replace cat ${coreutils}/bin/cat
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2021-02-05 17:12:51 +00:00
|
|
|
maintainers = [lib.maintainers.orbekk];
|
|
|
|
platforms = lib.platforms.linux;
|
2023-05-24 13:37:59 +00:00
|
|
|
description = "Tool to set battery charging thresholds on Lenovo Thinkpad";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.gpl3Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|