2016-11-08 02:46:34 +01:00
|
|
|
{ stdenv, fetchFromGitHub, perl, kmod }:
|
|
|
|
|
|
|
|
# Requires the acpi_call kernel module in order to run.
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "tpacpi-bat-${version}";
|
2017-06-20 03:01:26 +02:00
|
|
|
version = "3.1";
|
2016-11-08 02:46:34 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "teleshoes";
|
|
|
|
repo = "tpacpi-bat";
|
|
|
|
rev = "v${version}";
|
2017-06-20 03:01:26 +02:00
|
|
|
sha256 = "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5";
|
2016-11-08 02:46:34 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ perl ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp tpacpi-bat $out/bin
|
|
|
|
'';
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace tpacpi-bat --replace modprobe ${kmod}/bin/modprobe
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
maintainers = [stdenv.lib.maintainers.orbekk];
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
description = "Tool to set battery charging thesholds on Lenovo Thinkpad";
|
|
|
|
license = stdenv.lib.licenses.gpl3Plus;
|
|
|
|
};
|
|
|
|
}
|