15 stdenv.mkDerivation rec {
20 url = "https://github.com/NetworkBlockDevice/nbd/releases/download/nbd-${version}/nbd-${version}.tar.xz";
21 hash = "sha256-9cj9D8tXsckmWU0OV/NWQy7ghni+8dQNCI8IMPDL3Qo=";
25 # fix port setting from nbdtab
26 # https://github.com/NetworkBlockDevice/nbd/pull/154
28 url = "https://github.com/NetworkBlockDevice/nbd/commit/915444bc0b8a931d32dfb755542f4bd1d37f1449.patch";
29 hash = "sha256-6z+c2cXhY92WPDqRO6AJ5BBf1N38yTgOE1foduIr5Dg=";
42 ] ++ lib.optionals stdenv.hostPlatform.isLinux [
51 # ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
52 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=implicit-function-declaration";
54 doCheck = !stdenv.hostPlatform.isDarwin;
57 test = nixosTests.nbd;
61 homepage = "https://nbd.sourceforge.io/";
62 description = "Map arbitrary files as block devices over the network";
63 license = lib.licenses.gpl2Only;
64 platforms = lib.platforms.unix;
65 maintainers = with lib.maintainers; [ nickcao ];