···1+{ stdenv, fetchFromGitHub, pkgconfig, zlib, cmake, jemalloc }:
2+3+stdenv.mkDerivation rec {
4+ pname = "lwan";
5+ version = "0.1";
6+ name = "${pname}-${version}";
7+8+ src = fetchFromGitHub {
9+ owner = "lpereira";
10+ repo = pname;
11+ rev = "v${version}";
12+ sha256 = "1mckryzb06smky0bx2bkqwqzpnq4pb8vlgmmwsvqmwi4mmw9wmi1";
13+ };
14+15+ nativeBuildInputs = [ cmake pkgconfig ];
16+17+ buildInputs = [ jemalloc zlib ];
18+19+ meta = with stdenv.lib; {
20+ description = "Lightweight high-performance multi-threaded web server";
21+ longDescription = "A lightweight and speedy web server with a low memory
22+ footprint (~500KiB for 10k idle connections), with minimal system calls and
23+ memory allocation. Lwan contains a hand-crafted HTTP request parser. Files are
24+ served using the most efficient way according to their size: no copies between
25+ kernel and userland for files larger than 16KiB. Smaller files are sent using
26+ vectored I/O of memory-mapped buffers. Header overhead is considered before
27+ compressing small files. Features include: mustache templating engine and IPv6
28+ support.
29+ ";
30+ homepage = "https://lwan.ws/";
31+ license = licenses.gpl2;
32+ platforms = platforms.linux;
33+ maintainers = with maintainers; [ leenaars ];
34+ };
35+}