about summary refs log tree commit diff
path: root/pkgs/by-name/zc/zcfan
diff options
context:
space:
mode:
authorkashw2 <supra4keanu@hotmail.com>2023-09-06 15:56:18 +1000
committerWeijia Wang <9713184+wegank@users.noreply.github.com>2023-09-08 19:43:02 +0200
commit7a7d94c2423f22ced14413e7c13836569656814a (patch)
tree06d91db139a956e5ec5c99f94b029f05cd574c54 /pkgs/by-name/zc/zcfan
parentf95a262d751ad6678c81065f6b2391b54b5a5a0a (diff)
zcfan: init at 1.2.1
Diffstat (limited to 'pkgs/by-name/zc/zcfan')
-rw-r--r--pkgs/by-name/zc/zcfan/package.nix41
1 files changed, 41 insertions, 0 deletions
diff --git a/pkgs/by-name/zc/zcfan/package.nix b/pkgs/by-name/zc/zcfan/package.nix
new file mode 100644
index 0000000000000..4534a71fa3e4d
--- /dev/null
+++ b/pkgs/by-name/zc/zcfan/package.nix
@@ -0,0 +1,41 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+}:
+
+# Testing this requires a Thinkpad or the presence of /proc/acpi/ibm/fan
+stdenv.mkDerivation (finalAttrs: {
+  pname = "zcfan";
+  version = "1.2.1";
+
+  src = fetchFromGitHub {
+    owner = "cdown";
+    repo = "zcfan";
+    rev = finalAttrs.version;
+    hash = "sha256-XngchR06HP2iExKJVe+XKBDgsv98AEYWOkl1a/Hktgs=";
+  };
+
+  postPatch = ''
+    substituteInPlace Makefile \
+      --replace "/usr/local" $out
+  '';
+
+  doInstallCheck = true;
+
+  installCheckPhase = ''
+    runHook preInstallCheck
+
+    $out/bin/${finalAttrs.pname} -h
+
+    runHook postInstallCheck
+  '';
+
+  meta = with lib; {
+    description = "A zero-configuration fan daemon for ThinkPads";
+    homepage = "https://github.com/cdown/zcfan";
+    changelog = "https://github.com/cdown/zcfan/tags/${finalAttrs.version}";
+    license = licenses.mit;
+    maintainers = with maintainers; [ kashw2 ];
+    platforms = platforms.linux;
+  };
+})