nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 chardet,
6 humanfriendly,
7 pytestCheckHook,
8 setuptools-scm,
9 smartmontools,
10}:
11
12buildPythonPackage rec {
13 pname = "pysmart";
14 version = "1.4.2";
15 pyproject = true;
16
17 src = fetchFromGitHub {
18 owner = "truenas";
19 repo = "py-SMART";
20 tag = "v${version}";
21 hash = "sha256-h9FBAoNYLs5XvLxSajyktCCcNgiT7mIp472C+fbqZFA=";
22 };
23
24 postPatch = ''
25 substituteInPlace pySMART/utils.py \
26 --replace "which('smartctl')" '"${smartmontools}/bin/smartctl"'
27 '';
28
29 propagatedBuildInputs = [
30 chardet
31 humanfriendly
32 ];
33
34 nativeBuildInputs = [ setuptools-scm ];
35
36 nativeCheckInputs = [ pytestCheckHook ];
37
38 pythonImportsCheck = [ "pySMART" ];
39
40 meta = {
41 description = "Wrapper for smartctl (smartmontools)";
42 homepage = "https://github.com/truenas/py-SMART";
43 changelog = "https://github.com/truenas/py-SMART/blob/${src.tag}/CHANGELOG.md";
44 license = lib.licenses.lgpl21Only;
45 maintainers = with lib.maintainers; [ nyanloutre ];
46 };
47}