nixpkgs/pkgs/os-specific/linux/tpacpi-bat/default.nix

35 lines
826 B
Nix
Raw Normal View History

2021-01-15 15:45:37 +01:00
{ lib, stdenv, fetchFromGitHub, perl, kmod, coreutils }:
2016-11-08 02:46:34 +01:00
# Requires the acpi_call kernel module in order to run.
stdenv.mkDerivation rec {
pname = "tpacpi-bat";
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 = ''
2018-07-15 19:01:59 +02:00
substituteInPlace tpacpi-bat \
--replace modprobe ${kmod}/bin/modprobe \
--replace cat ${coreutils}/bin/cat
2016-11-08 02:46:34 +01:00
'';
meta = {
2021-01-15 15:45:37 +01:00
maintainers = [lib.maintainers.orbekk];
platforms = lib.platforms.linux;
2016-11-08 02:46:34 +01:00
description = "Tool to set battery charging thesholds on Lenovo Thinkpad";
2021-01-15 15:45:37 +01:00
license = lib.licenses.gpl3Plus;
2016-11-08 02:46:34 +01:00
};
}