2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, pkg-config, gnutls, liburcu, lmdb, libcap_ng, libidn2, libunistring
|
2021-08-05 21:33:18 +00:00
|
|
|
, systemd, nettle, libedit, zlib, libiconv, libintl, libmaxminddb, libbpf, nghttp2, libmnl
|
2021-12-24 04:21:11 +00:00
|
|
|
, autoreconfHook, nixosTests, knot-resolver
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "knot-dns";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "3.1.9";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://secure.nic.cz/files/knot-dns/knot-${version}.tar.xz";
|
2022-08-12 12:06:08 +00:00
|
|
|
sha256 = "sha256-s8pPHUROlf8n0gltPMWkfBDB1poeSIWuipcngfYnnYI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "bin" "out" "dev" ];
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--with-configdir=/etc/knot"
|
|
|
|
"--with-rundir=/run/knot"
|
|
|
|
"--with-storage=/var/lib/knot"
|
|
|
|
];
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Don't try to create directories like /var/lib/knot at build time.
|
|
|
|
# They are later created from NixOS itself.
|
|
|
|
./dont-create-run-time-dirs.patch
|
2020-09-25 04:45:31 +00:00
|
|
|
./runtime-deps.patch
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config autoreconfHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
|
|
|
gnutls liburcu libidn2 libunistring
|
|
|
|
nettle libedit
|
|
|
|
libiconv lmdb libintl
|
2020-09-25 04:45:31 +00:00
|
|
|
nghttp2 # DoH support in kdig
|
2020-08-20 17:08:02 +00:00
|
|
|
libmaxminddb # optional for geoip module (it's tiny)
|
2020-04-24 23:36:52 +00:00
|
|
|
# without sphinx &al. for developer documentation
|
2020-09-25 04:45:31 +00:00
|
|
|
# TODO: add dnstap support?
|
2021-08-05 21:33:18 +00:00
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
libcap_ng systemd
|
|
|
|
libbpf libmnl # XDP support (it's Linux kernel API)
|
|
|
|
] ++ lib.optional stdenv.isDarwin zlib; # perhaps due to gnutls
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
CFLAGS = [ "-O2" "-DNDEBUG" ];
|
|
|
|
|
|
|
|
doCheck = true;
|
2021-06-28 23:13:55 +00:00
|
|
|
checkFlags = "V=1"; # verbose output in case some test fails
|
2020-10-16 20:44:37 +00:00
|
|
|
doInstallCheck = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
rm -r "$out"/lib/*.la
|
|
|
|
'';
|
|
|
|
|
2021-12-24 04:21:11 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit knot-resolver;
|
|
|
|
} // lib.optionalAttrs stdenv.isLinux {
|
|
|
|
inherit (nixosTests) knot;
|
|
|
|
};
|
2021-06-28 23:13:55 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Authoritative-only DNS server from .cz domain registry";
|
|
|
|
homepage = "https://knot-dns.cz";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = [ maintainers.vcunat ];
|
|
|
|
};
|
|
|
|
}
|