1# Getdns and Stubby are released together, see https://getdnsapi.net/releases/
2# ../../ge/getdns/package.nix
3
4{
5 lib,
6 stdenv,
7 cmake,
8 getdns,
9 libyaml,
10 openssl,
11 systemd,
12 yq,
13 stubby,
14}:
15
16stdenv.mkDerivation (finalAttrs: {
17 pname = "stubby";
18 version = "0.4.3";
19 outputs = [
20 "out"
21 "man"
22 "stubbyExampleJson"
23 ];
24
25 inherit (getdns) src;
26 sourceRoot = "${getdns.pname}-${getdns.version}/stubby";
27
28 nativeBuildInputs = [
29 cmake
30 yq
31 ];
32
33 buildInputs = [
34 getdns
35 libyaml
36 openssl
37 ]
38 ++ lib.optionals stdenv.hostPlatform.isLinux [ systemd ];
39
40 postInstall = ''
41 rm -r $out/share/doc
42 yq \
43 < $NIX_BUILD_TOP/$sourceRoot/stubby.yml.example \
44 > $stubbyExampleJson
45 '';
46
47 passthru.settingsExample = builtins.fromJSON (builtins.readFile stubby.stubbyExampleJson);
48
49 meta = getdns.meta // {
50 description = "Local DNS Privacy stub resolver (using DNS-over-TLS)";
51 mainProgram = "stubby";
52 longDescription = ''
53 Stubby is an application that acts as a local DNS Privacy stub
54 resolver (using RFC 7858, aka DNS-over-TLS). Stubby encrypts DNS
55 queries sent from a client machine (desktop or laptop) to a DNS
56 Privacy resolver increasing end user privacy. Stubby is developed by
57 the getdns team.
58 '';
59 homepage = "https://dnsprivacy.org/dns_privacy_daemon_-_stubby/";
60 };
61})