about summary refs log tree commit diff
path: root/pkgs/by-name
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2023-09-08 20:29:54 +0200
committerGitHub <noreply@github.com>2023-09-08 20:29:54 +0200
commit7dc6783ecf8ae22c4a89a6ca4be74de238262045 (patch)
treee3ae98298fd6a51555e1533733e47ecb2d88c366 /pkgs/by-name
parent229ae1c25689d0b8a2f37eb0cc3251b909d9cd8d (diff)
parent7a7d94c2423f22ced14413e7c13836569656814a (diff)
Merge pull request #253579 from kashw2/zcfan
zcfan: init at 1.2.1
Diffstat (limited to 'pkgs/by-name')
-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;
+  };
+})