{ stdenv, fetchurl, fetchpatch # native deps. , runCommand, pkgconfig, meson, ninja, makeWrapper # build+runtime deps. , knot-dns, luajitPackages, libuv, gnutls, lmdb, systemd, dns-root-data # test-only deps. , cmocka, which, cacert , extraFeatures ? false /* catch-all if defaults aren't enough */ }: let # un-indented, over the whole file result = if extraFeatures then wrapped-full else unwrapped; inherit (stdenv.lib) optional optionals; lua = luajitPackages; unwrapped = stdenv.mkDerivation rec { pname = "knot-resolver"; version = "5.1.3"; src = fetchurl { url = "https://secure.nic.cz/files/knot-resolver/${pname}-${version}.tar.xz"; sha256 = "20cd829027e39a9f7d993894e3640e886825b492d9ac1a744ac5616cc101458b"; }; outputs = [ "out" "dev" ]; # Path fixups for the NixOS service. postPatch = '' patch meson.build < test-http.lua echo -e 'quit()' | env -i "$out"/bin/kresd -a 127.0.0.1#53535 -c test-http.lua ''; in result