3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/servers/dns/knot-dns/default.nix

70 lines
1.9 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, pkg-config, gnutls, liburcu, lmdb, libcap_ng, libidn2, libunistring
, systemd, nettle, libedit, zlib, libiconv, libintl, libmaxminddb, libbpf, nghttp2, libmnl
, autoreconfHook, nixosTests, knot-resolver
}:
stdenv.mkDerivation rec {
pname = "knot-dns";
version = "3.1.5";
src = fetchurl {
url = "https://secure.nic.cz/files/knot-dns/knot-${version}.tar.xz";
sha256 = "2da6e50b0662297d55f80e349568224e07fe88cad20bee1d2e22f54bb32da064";
};
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
./runtime-deps.patch
];
nativeBuildInputs = [ pkg-config autoreconfHook ];
buildInputs = [
gnutls liburcu libidn2 libunistring
nettle libedit
2018-03-14 19:15:06 +00:00
libiconv lmdb libintl
nghttp2 # DoH support in kdig
libmaxminddb # optional for geoip module (it's tiny)
# without sphinx &al. for developer documentation
# TODO: add dnstap support?
2021-08-02 12:12:10 +01:00
] ++ lib.optionals stdenv.isLinux [
libcap_ng systemd
libbpf libmnl # XDP support (it's Linux kernel API)
2021-08-02 12:12:10 +01:00
] ++ lib.optional stdenv.isDarwin zlib; # perhaps due to gnutls
enableParallelBuilding = true;
CFLAGS = [ "-O2" "-DNDEBUG" ];
doCheck = true;
checkFlags = "V=1"; # verbose output in case some test fails
2020-09-14 10:20:52 +01:00
doInstallCheck = true;
postInstall = ''
rm -r "$out"/lib/*.la
'';
passthru.tests = {
inherit knot-resolver;
} // lib.optionalAttrs stdenv.isLinux {
inherit (nixosTests) knot;
};
meta = with lib; {
description = "Authoritative-only DNS server from .cz domain registry";
homepage = "https://knot-dns.cz";
license = licenses.gpl3Plus;
platforms = platforms.unix;
maintainers = [ maintainers.vcunat ];
};
}