From 0d5caf138a6dd38fe1cb085f01e1c216ce026890 Mon Sep 17 00:00:00 2001 From: Kjetil Ørbekk Date: Mon, 7 Nov 2016 20:46:34 -0500 Subject: tpacpi-bat: init at 3.0 (#20213) --- pkgs/os-specific/linux/tpacpi-bat/default.nix | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 pkgs/os-specific/linux/tpacpi-bat/default.nix (limited to 'pkgs/os-specific/linux/tpacpi-bat') diff --git a/pkgs/os-specific/linux/tpacpi-bat/default.nix b/pkgs/os-specific/linux/tpacpi-bat/default.nix new file mode 100644 index 00000000000..bf60331d8ad --- /dev/null +++ b/pkgs/os-specific/linux/tpacpi-bat/default.nix @@ -0,0 +1,32 @@ +{ stdenv, fetchFromGitHub, perl, kmod }: + +# Requires the acpi_call kernel module in order to run. +stdenv.mkDerivation rec { + name = "tpacpi-bat-${version}"; + version = "3.0"; + + src = fetchFromGitHub { + owner = "teleshoes"; + repo = "tpacpi-bat"; + rev = "v${version}"; + sha256 = "0l72qvjk5j7sg9x4by7an0xwx65x10dx82fky8lnwlwfv54vgg8l"; + }; + + buildInputs = [ perl ]; + + installPhase = '' + mkdir -p $out/bin + cp tpacpi-bat $out/bin + ''; + + postPatch = '' + substituteInPlace tpacpi-bat --replace modprobe ${kmod}/bin/modprobe + ''; + + 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; + }; +} -- cgit 1.4.1