@@ -0,0 +1,31 @@
1+{ lib, rustPlatform, fetchFromGitHub, libXNVCtrl, libX11, libXext }:
2+
3+rustPlatform.buildRustPackage rec {
4+ pname = "nvfancontrol";
5+ version = "0.5.1";
6+
7+ src = fetchFromGitHub {
8+ owner = "foucault";
9+ repo = pname;
10+ rev = version;
11+ sha256 = "sha256-0WBQSnTYVc3sNmZf/KFzznMg9AVsyaBgdx/IvG1dZAw=";
12+ };
13+
14+ cargoSha256 = "sha256-fEzdghGQSSeyeyiHjw1ggQ38gsETJFl9bq/tizGxIis=";
15+
16+ nativeBuildInputs = [ libXNVCtrl libX11 libXext ];
17+
18+ # Needed for static linking
19+ preConfigure = ''
20+ export LIBRARY_PATH=${libXNVCtrl}/lib:${libX11}/lib:${libXext}/lib
21+ '';
22+
23+ meta = with lib; {
24+ description = "NVidia dynamic fan control for Linux";
25+ homepage = "https://github.com/foucault/nvfancontrol";
26+ changelog = "https://github.com/foucault/nvfancontrol/releases/tag/${version}";
27+ license = with licenses; [ gpl3Only ];
28+ platforms = platforms.linux;
29+ maintainers = with maintainers; [ devins2518 ];
30+ };
31+}