1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs synced 2024-10-19 03:47:13 -04:00
nixpkgs/pkgs/os-specific/linux/tpacpi-bat/default.nix

35 lines
852 B
Nix
Raw Normal View History

2018-07-15 13:01:59 -04:00
{ stdenv, fetchFromGitHub, perl, kmod, coreutils }:
2016-11-07 20:46:34 -05:00
# Requires the acpi_call kernel module in order to run.
stdenv.mkDerivation rec {
name = "tpacpi-bat-${version}";
2017-06-19 21:01:26 -04:00
version = "3.1";
2016-11-07 20:46:34 -05:00
src = fetchFromGitHub {
owner = "teleshoes";
repo = "tpacpi-bat";
rev = "v${version}";
2017-06-19 21:01:26 -04:00
sha256 = "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5";
2016-11-07 20:46:34 -05:00
};
buildInputs = [ perl ];
installPhase = ''
mkdir -p $out/bin
cp tpacpi-bat $out/bin
'';
postPatch = ''
2018-07-15 13:01:59 -04:00
substituteInPlace tpacpi-bat \
--replace modprobe ${kmod}/bin/modprobe \
--replace cat ${coreutils}/bin/cat
2016-11-07 20:46:34 -05:00
'';
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;
};
}