1 # Getdns and Stubby are released together, see https://getdnsapi.net/releases/
3 { lib, stdenv, fetchurl, cmake, darwin, doxygen, libidn2, libyaml, openssl
4 , systemd, unbound, yq }:
7 maintainers = with lib.maintainers; [ leenaars ehmry ];
8 license = lib.licenses.bsd3;
9 platforms = lib.platforms.all;
13 getdns = stdenv.mkDerivation rec {
16 outputs = [ "out" "dev" "lib" "man" ];
19 url = "https://getdnsapi.net/releases/${pname}-${lib.concatStringsSep "-" (lib.splitVersion version)}/${pname}-${version}.tar.gz";
20 # upstream publishes hashes in hex format
21 sha256 = "f1404ca250f02e37a118aa00cf0ec2cbe11896e060c6d369c6761baea7d55a2c";
24 nativeBuildInputs = [ cmake doxygen ];
26 buildInputs = [ libidn2 openssl unbound ];
28 # https://github.com/getdnsapi/getdns/issues/517
30 substituteInPlace getdns.pc.in \
31 --replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \
32 --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@
35 postInstall = "rm -r $out/share/doc";
37 meta = metaCommon // {
38 description = "Modern asynchronous DNS API";
40 getdns is an implementation of a modern asynchronous DNS API; the
41 specification was originally edited by Paul Hoffman. It is intended to make all
42 types of DNS information easily available to application developers and non-DNS
43 experts. DNSSEC offers a unique global infrastructure for establishing and
44 enhancing cryptographic trust relations. With the development of this API the
45 developers intend to offer application developers a modern and flexible
46 interface that enables end-to-end trust in the DNS architecture, and which will
47 inspire application developers to implement innovative security solutions in
50 homepage = "https://getdnsapi.net";
54 stubby = stdenv.mkDerivation rec {
57 outputs = [ "out" "man" "stubbyExampleJson" ];
60 sourceRoot = "${getdns.pname}-${getdns.version}/stubby";
62 nativeBuildInputs = [ cmake doxygen yq ];
64 buildInputs = [ getdns libyaml openssl systemd ]
65 ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.Security ];
70 < $NIX_BUILD_TOP/$sourceRoot/stubby.yml.example \
74 passthru.settingsExample = builtins.fromJSON (builtins.readFile stubby.stubbyExampleJson);
76 meta = metaCommon // {
77 description = "Local DNS Privacy stub resolver (using DNS-over-TLS)";
78 mainProgram = "stubby";
80 Stubby is an application that acts as a local DNS Privacy stub
81 resolver (using RFC 7858, aka DNS-over-TLS). Stubby encrypts DNS
82 queries sent from a client machine (desktop or laptop) to a DNS
83 Privacy resolver increasing end user privacy. Stubby is developed by
86 homepage = "https://dnsprivacy.org/dns_privacy_daemon_-_stubby/";