Files
nixpkgs/pkgs/by-name/th/thinkfan/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

75 lines
1.8 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
cmake,
lm_sensors,
yaml-cpp,
pkg-config,
procps,
smartSupport ? false,
libatasmart,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "thinkfan";
version = "2.0.0";
src = fetchFromGitHub {
owner = "vmatare";
repo = "thinkfan";
tag = finalAttrs.version;
hash = "sha256-QqDWPOXy8E+TY5t0fFRAS8BGA7ZH90xecv5UsFfDssk=";
};
postPatch = # fix hardcoded install path
''
substituteInPlace CMakeLists.txt \
--replace-fail "/etc" "$out/etc"
''
# fix command paths in unit files
+ ''
substituteInPlace rcscripts/systemd/thinkfan-sleep.service \
--replace-fail "/usr/bin/pkill" "${lib.getExe' procps "pkill"}"
substituteInPlace rcscripts/systemd/thinkfan-wakeup.service \
--replace-fail "/usr/bin/pkill" "${lib.getExe' procps "pkill"}"
substituteInPlace rcscripts/systemd/thinkfan.service.cmake \
--replace-fail "/bin/kill" "${lib.getExe' procps "kill"}"
'';
cmakeFlags = [
"-DCMAKE_INSTALL_DOCDIR=share/doc/thinkfan"
"-DUSE_NVML=OFF"
# force install unit files
"-DSYSTEMD_FOUND=ON"
]
++ lib.optional smartSupport "-DUSE_ATASMART=ON";
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
lm_sensors
yaml-cpp
]
++ lib.optional smartSupport libatasmart;
meta = {
description = "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";
maintainers = with lib.maintainers; [
rnhmjoj
];
platforms = lib.platforms.linux;
mainProgram = "thinkfan";
};
})