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