summary refs log tree commit diff
path: root/pkgs/tools/system
diff options
context:
space:
mode:
authorBenjamin Staffin <bstaffin@singlestore.com>2023-06-25 12:30:12 -0400
committerBenjamin Staffin <bstaffin@singlestore.com>2023-08-23 13:25:20 -0400
commit8deb8a1fcf0cb1b91696fed999425cbe22e01536 (patch)
treed7b61ee9ee21ac46603d6a73483e7a560911e7cf /pkgs/tools/system
parent932dc0d4415c919db0261eeda6bfff8827b9bf3a (diff)
hddfancontrol: init at 1.5.1
Diffstat (limited to 'pkgs/tools/system')
-rw-r--r--pkgs/tools/system/hddfancontrol/default.nix34
1 files changed, 34 insertions, 0 deletions
diff --git a/pkgs/tools/system/hddfancontrol/default.nix b/pkgs/tools/system/hddfancontrol/default.nix
new file mode 100644
index 0000000000000..5a4aeaa3a53ea
--- /dev/null
+++ b/pkgs/tools/system/hddfancontrol/default.nix
@@ -0,0 +1,34 @@
+{ lib, python3Packages, fetchFromGitHub, hddtemp, hdparm, smartmontools }:
+
+python3Packages.buildPythonPackage rec {
+  pname = "hddfancontrol";
+  version = "1.5.1";
+
+  src = fetchFromGitHub {
+    owner = "desbma";
+    repo = pname;
+    rev = version;
+    sha256 = "0b2grf98qnikayn18xll01dkm5pjpcjxdffgx1nyw9s0gqig8dg0";
+  };
+
+  propagatedBuildInputs = [
+    python3Packages.python-daemon
+    hddtemp
+    hdparm
+    smartmontools
+  ];
+
+  postInstall = ''
+    mkdir -p $out/etc/systemd/system
+    substitute systemd/hddfancontrol.service $out/etc/systemd/system/hddfancontrol.service \
+        --replace /usr/bin/hddfancontrol $out/bin/hddfancontrol
+    sed -i -e '/EnvironmentFile=.*/d' $out/etc/systemd/system/hddfancontrol.service
+  '';
+
+  meta = with lib; {
+    description = "Dynamically control fan speed according to hard drive temperature on Linux";
+    homepage = "https://github.com/desbma/hddfancontrol";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ benley ];
+  };
+}