···11+{ stdenv, fetchFromGitHub, pkgconfig, zlib, cmake, jemalloc }:
22+33+stdenv.mkDerivation rec {
44+ pname = "lwan";
55+ version = "0.1";
66+ name = "${pname}-${version}";
77+88+ src = fetchFromGitHub {
99+ owner = "lpereira";
1010+ repo = pname;
1111+ rev = "v${version}";
1212+ sha256 = "1mckryzb06smky0bx2bkqwqzpnq4pb8vlgmmwsvqmwi4mmw9wmi1";
1313+ };
1414+1515+ nativeBuildInputs = [ cmake pkgconfig ];
1616+1717+ buildInputs = [ jemalloc zlib ];
1818+1919+ meta = with stdenv.lib; {
2020+ description = "Lightweight high-performance multi-threaded web server";
2121+ longDescription = "A lightweight and speedy web server with a low memory
2222+ footprint (~500KiB for 10k idle connections), with minimal system calls and
2323+ memory allocation. Lwan contains a hand-crafted HTTP request parser. Files are
2424+ served using the most efficient way according to their size: no copies between
2525+ kernel and userland for files larger than 16KiB. Smaller files are sent using
2626+ vectored I/O of memory-mapped buffers. Header overhead is considered before
2727+ compressing small files. Features include: mustache templating engine and IPv6
2828+ support.
2929+ ";
3030+ homepage = "https://lwan.ws/";
3131+ license = licenses.gpl2;
3232+ platforms = platforms.linux;
3333+ maintainers = with maintainers; [ leenaars ];
3434+ };
3535+}