1{ lib, stdenv, fetchFromGitHub, pkg-config
2, meson
3, ninja
4, libnvme
5, json_c
6, zlib
7, libhugetlbfs
8, python3Packages
9}:
10
11stdenv.mkDerivation rec {
12 pname = "nvme-cli";
13 version = "2.6";
14
15 src = fetchFromGitHub {
16 owner = "linux-nvme";
17 repo = "nvme-cli";
18 rev = "v${version}";
19 hash = "sha256-MFyBkwTNOBQdHWj7In1OquRIAsjsd4/DHYfUyFA9YDQ=";
20 };
21
22 mesonFlags = [
23 "-Dversion-tag=${version}"
24 ];
25
26 nativeBuildInputs = [
27 meson
28 ninja
29 pkg-config
30 python3Packages.nose2
31 ];
32 buildInputs = [
33 libnvme
34 json_c
35 zlib
36 ] ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform libhugetlbfs) [
37 libhugetlbfs
38 ];
39
40 meta = with lib; {
41 inherit (src.meta) homepage; # https://nvmexpress.org/
42 description = "NVM-Express user space tooling for Linux";
43 longDescription = ''
44 NVM-Express is a fast, scalable host controller interface designed to
45 address the needs for not only PCI Express based solid state drives, but
46 also NVMe-oF(over fabrics).
47 This nvme program is a user space utility to provide standards compliant
48 tooling for NVM-Express drives. It was made specifically for Linux as it
49 relies on the IOCTLs defined by the mainline kernel driver.
50 '';
51 license = licenses.gpl2Plus;
52 platforms = platforms.linux;
53 maintainers = with maintainers; [ mic92 vifino ];
54 mainProgram = "nvme";
55 };
56}