about summary refs log tree commit diff
path: root/nixpkgs/pkgs/os-specific/linux/lm-sensors
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/os-specific/linux/lm-sensors')
-rw-r--r--nixpkgs/pkgs/os-specific/linux/lm-sensors/default.nix31
1 files changed, 31 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/os-specific/linux/lm-sensors/default.nix b/nixpkgs/pkgs/os-specific/linux/lm-sensors/default.nix
new file mode 100644
index 000000000000..0536ba064a3d
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/lm-sensors/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchzip, bison, flex, which, perl
+, sensord ? false, rrdtool ? null
+}:
+
+assert sensord -> rrdtool != null;
+
+stdenv.mkDerivation rec {
+  name = "lm-sensors-${version}";
+  version = "3.5.0";
+
+  src = fetchzip {
+    url = "https://github.com/lm-sensors/lm-sensors/archive/V${stdenv.lib.replaceStrings ["."] ["-"] version}.tar.gz";
+    sha256 = "1mdrnb9r01z1xfdm6dpkywvf9yy9a4yzb59paih9sijwmigv19fj";
+  };
+
+  nativeBuildInputs = [ bison flex which ];
+  buildInputs = [ perl ]
+   ++ stdenv.lib.optional sensord rrdtool;
+
+  preBuild = ''
+    makeFlagsArray=(PREFIX=$out ETCDIR=$out/etc
+    ${stdenv.lib.optionalString sensord "PROG_EXTRA=sensord"})
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://hwmon.wiki.kernel.org/lm_sensors;
+    description = "Tools for reading hardware sensors";
+    license = with licenses; [ gpl2Plus lgpl21Plus ];
+    platforms = platforms.linux;
+  };
+}