Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 44 lines 1.0 kB view raw
1{ 2 fetchFromGitHub, 3 lib, 4 python3, 5 smartmontools, 6 stdenv, 7}: 8 9stdenv.mkDerivation rec { 10 pname = "check-smartmon"; 11 version = "1.0.1"; 12 13 src = fetchFromGitHub { 14 owner = "driehuis"; 15 repo = "Nagios_check_smartmon"; 16 tag = version; 17 sha256 = "tiIeFiHdDgqoeznk9XdCE7owIMnnsQ0fmtj8foFoUD8="; 18 }; 19 20 buildInputs = [ 21 (python3.withPackages (pp: [ pp.psutil ])) 22 smartmontools 23 ]; 24 25 postPatch = '' 26 patchShebangs check_smartmon.py 27 substituteInPlace check_smartmon.py \ 28 --replace-fail '"/usr/sbin/smartctl"' '"${smartmontools}/bin/smartctl"' 29 ''; 30 31 installPhase = '' 32 runHook preInstall 33 install -Dm 755 check_smartmon.py $out/bin/check_smartmon 34 runHook postInstall 35 ''; 36 37 meta = { 38 description = "Nagios-Plugin that uses smartmontools to check disk health status and temperature"; 39 mainProgram = "check_smartmon"; 40 homepage = "https://github.com/driehuis/Nagios_check_smartmon"; 41 license = lib.licenses.gpl2Plus; 42 maintainers = with lib.maintainers; [ mariaa144 ]; 43 }; 44}