mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-30 11:50:06 +00:00
Added homepage where missing, where the sources are pulled from: - https://github.com - https://git.sr.ht - https://gitlab.com - https://invent.kde.org - https://codeberg.org - https://gitlab.gnome.org - https://gitlab.freedesktop.org - https://git.FreeBSD.org - https://salsa.debian.org - https://git.tvdr.de - https://git.suckless.org
44 lines
952 B
Nix
44 lines
952 B
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
perl,
|
|
kmod,
|
|
coreutils,
|
|
}:
|
|
|
|
# Requires the acpi_call kernel module in order to run.
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "tpacpi-bat";
|
|
version = "3.2";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "teleshoes";
|
|
repo = "tpacpi-bat";
|
|
rev = "v${finalAttrs.version}";
|
|
sha256 = "sha256-9XnvVNdgB5VeI3juZfc8N5weEyULXuqu1IDChZfQqFk=";
|
|
};
|
|
|
|
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 = [ lib.maintainers.orbekk ];
|
|
platforms = lib.platforms.linux;
|
|
description = "Tool to set battery charging thresholds on Lenovo Thinkpad";
|
|
homepage = "https://github.com/teleshoes/tpacpi-bat";
|
|
mainProgram = "tpacpi-bat";
|
|
license = lib.licenses.gpl3Plus;
|
|
};
|
|
})
|