8ac5e011d6
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
34 lines
842 B
Nix
34 lines
842 B
Nix
{ stdenv, fetchFromGitHub, perl, kmod, coreutils }:
|
|
|
|
# Requires the acpi_call kernel module in order to run.
|
|
stdenv.mkDerivation rec {
|
|
pname = "tpacpi-bat";
|
|
version = "3.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "teleshoes";
|
|
repo = "tpacpi-bat";
|
|
rev = "v${version}";
|
|
sha256 = "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5";
|
|
};
|
|
|
|
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 = {
|
|
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;
|
|
};
|
|
}
|