nixpkgs/pkgs/tools/system/thinkfan/default.nix

48 lines
1.4 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub, cmake, libyamlcpp, pkg-config
, smartSupport ? false, libatasmart }:
2013-04-06 00:34:50 +02:00
2015-12-27 21:21:43 +01:00
stdenv.mkDerivation rec {
pname = "thinkfan";
2020-12-07 15:38:22 +01:00
version = "1.2.1";
2013-04-06 00:34:50 +02:00
2019-02-16 11:51:59 +01:00
src = fetchFromGitHub {
owner = "vmatare";
repo = "thinkfan";
rev = version;
2020-12-07 15:38:22 +01:00
sha256 = "18vgm5w5pjnpipa34j4x87q10695w2jnqwvc2f027afy7mnzw7kz";
2013-04-06 00:34:50 +02:00
};
2015-12-27 21:21:43 +01:00
cmakeFlags = [
"-DCMAKE_INSTALL_DOCDIR=share/doc/${pname}"
2019-02-16 11:51:59 +01:00
"-DUSE_NVML=OFF"
2021-01-15 10:19:50 +01:00
] ++ lib.optional smartSupport "-DUSE_ATASMART=ON";
2015-12-27 21:21:43 +01:00
nativeBuildInputs = [ cmake pkg-config ];
2019-02-16 11:51:59 +01:00
2021-01-15 10:19:50 +01:00
buildInputs = [ libyamlcpp ] ++ lib.optional smartSupport libatasmart;
2013-04-06 00:34:50 +02:00
installPhase = ''
runHook preInstall
install -Dm755 {.,$out/bin}/thinkfan
cd "$NIX_BUILD_TOP"; cd "$sourceRoot" # attempt to be a bit robust
2020-12-07 15:38:22 +01:00
install -Dm644 {.,$out/share/doc/thinkfan}/README.md
cp -R examples $out/share/doc/thinkfan
install -Dm644 {src,$out/share/man/man1}/thinkfan.1
runHook postInstall
2013-04-06 00:34:50 +02:00
'';
meta = with lib; {
description = "A minimalist fan control program";
longDescription = "A minimalist fan control program. Originally designed
specifically for IBM/Lenovo Thinkpads, it now supports any kind of system via
the sysfs hwmon interface (/sys/class/hwmon).";
license = licenses.gpl3;
homepage = "https://github.com/vmatare/thinkfan";
maintainers = with maintainers; [ domenkozar ];
platforms = platforms.linux;
2013-04-06 00:34:50 +02:00
};
}