2022-08-12 12:06:08 +00:00
|
|
|
{ lib, stdenv, fetchurl, pkg-config, glib, which, bison, nixosTests, linuxHeaders, gnutls }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-08-05 21:33:18 +00:00
|
|
|
pname = "nbd";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "3.25";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-05-24 13:37:59 +00:00
|
|
|
url = "https://github.com/NetworkBlockDevice/nbd/releases/download/nbd-${version}/nbd-${version}.tar.xz";
|
|
|
|
hash = "sha256-9cj9D8tXsckmWU0OV/NWQy7ghni+8dQNCI8IMPDL3Qo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
buildInputs = [ glib gnutls ]
|
|
|
|
++ lib.optionals stdenv.isLinux [ linuxHeaders ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
nativeBuildInputs = [ pkg-config which bison ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2021-08-05 21:33:18 +00:00
|
|
|
mkdir -p "$out/share/doc/nbd-${version}"
|
|
|
|
cp README.md "$out/share/doc/nbd-${version}/"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
doCheck = !stdenv.isDarwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
passthru.tests = {
|
|
|
|
test = nixosTests.nbd;
|
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
2022-08-12 12:06:08 +00:00
|
|
|
homepage = "https://nbd.sourceforge.io/";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Map arbitrary files as block devices over the network";
|
2021-01-15 22:18:51 +00:00
|
|
|
license = lib.licenses.gpl2;
|
2022-08-12 12:06:08 +00:00
|
|
|
platforms = lib.platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|