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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
858 B
Nix
Raw Normal View History

2021-01-15 14:45:37 +00:00
{ lib, stdenv, fetchFromGitHub, perl, kmod, coreutils }:
2016-11-08 01:46:34 +00:00
# Requires the acpi_call kernel module in order to run.
stdenv.mkDerivation rec {
pname = "tpacpi-bat";
2023-08-25 03:08:55 +00:00
version = "3.2";
2016-11-08 01:46:34 +00:00
src = fetchFromGitHub {
owner = "teleshoes";
repo = "tpacpi-bat";
rev = "v${version}";
2023-08-25 03:08:55 +00:00
sha256 = "sha256-9XnvVNdgB5VeI3juZfc8N5weEyULXuqu1IDChZfQqFk=";
2016-11-08 01:46:34 +00:00
};
buildInputs = [ perl ];
installPhase = ''
mkdir -p $out/bin
cp tpacpi-bat $out/bin
'';
postPatch = ''
2018-07-15 17:01:59 +00:00
substituteInPlace tpacpi-bat \
--replace modprobe ${kmod}/bin/modprobe \
--replace cat ${coreutils}/bin/cat
2016-11-08 01:46:34 +00:00
'';
meta = {
2021-01-15 14:45:37 +00:00
maintainers = [lib.maintainers.orbekk];
platforms = lib.platforms.linux;
description = "Tool to set battery charging thresholds on Lenovo Thinkpad";
mainProgram = "tpacpi-bat";
2021-01-15 14:45:37 +00:00
license = lib.licenses.gpl3Plus;
2016-11-08 01:46:34 +00:00
};
}