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

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

61 lines
1.6 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, fetchFromGitHub
, cmake
, yaml-cpp
, pkg-config
, procps
, coreutils
, smartSupport ? false, libatasmart
}:
2013-04-05 22:34:50 +00:00
2015-12-27 20:21:43 +00:00
stdenv.mkDerivation rec {
pname = "thinkfan";
2022-02-08 07:18:28 +00:00
version = "1.3.1";
2013-04-05 22:34:50 +00:00
2019-02-16 10:51:59 +00:00
src = fetchFromGitHub {
owner = "vmatare";
repo = "thinkfan";
rev = version;
2022-02-08 07:18:28 +00:00
sha256 = "sha256-aREZv+t4QhtfLKOMrneLiRxgnu0fzB8UV8dvr1dnhx4=";
2013-04-05 22:34:50 +00:00
};
2015-12-27 20:21:43 +00:00
2021-02-03 10:37:45 +00:00
postPatch = ''
# fix hardcoded install path
substituteInPlace CMakeLists.txt --replace /etc $out/etc
# fix command paths in unit files
for unit in rcscripts/systemd/*; do
substituteInPlace "$unit" \
--replace /bin/kill ${procps}/bin/kill \
--replace /usr/bin/pkill ${procps}/bin/pkill \
--replace /usr/bin/sleep ${coreutils}/bin/sleep
done
'';
cmakeFlags = [
"-DCMAKE_INSTALL_DOCDIR=share/doc/${pname}"
2019-02-16 10:51:59 +00:00
"-DUSE_NVML=OFF"
2021-02-03 10:37:45 +00:00
# force install unit files
"-DSYSTEMD_FOUND=ON"
2021-01-15 09:19:50 +00:00
] ++ lib.optional smartSupport "-DUSE_ATASMART=ON";
2015-12-27 20:21:43 +00:00
nativeBuildInputs = [ cmake pkg-config ];
2019-02-16 10:51:59 +00:00
buildInputs = [ yaml-cpp ] ++ lib.optional smartSupport libatasmart;
meta = {
description = "A simple, lightweight fan control program";
longDescription = ''
Thinkfan is 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 = lib.licenses.gpl3Plus;
homepage = "https://github.com/vmatare/thinkfan";
2021-02-03 10:29:34 +00:00
maintainers = with lib.maintainers; [ domenkozar rnhmjoj ];
platforms = lib.platforms.linux;
2023-11-27 01:17:53 +00:00
mainProgram = "thinkfan";
2013-04-05 22:34:50 +00:00
};
}