{ 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.2"; src = fetchurl { url = "https://secure.nic.cz/files/knot-resolver/${pname}-${version}.tar.xz"; sha256 = "caa4f941caf39080184554fb1310f383eba4b30d9c4c2215670d6b0a2de8f836"; }; 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