1import ./make-test-python.nix ({ pkgs, ... }: let
2 localProxyPort = 43;
3in {
4 name = "dnscrypt-proxy2";
5 meta = with pkgs.lib.maintainers; {
6 maintainers = [ joachifm ];
7 };
8
9 nodes = {
10 # A client running the recommended setup: DNSCrypt proxy as a forwarder
11 # for a caching DNS client.
12 client =
13 { ... }:
14 {
15 security.apparmor.enable = true;
16
17 services.dnscrypt-proxy2.enable = true;
18 services.dnscrypt-proxy2.settings = {
19 listen_addresses = [ "127.0.0.1:${toString localProxyPort}" ];
20 sources.public-resolvers = {
21 urls = [ "https://download.dnscrypt.info/resolvers-list/v2/public-resolvers.md" ];
22 cache_file = "public-resolvers.md";
23 minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3";
24 refresh_delay = 72;
25 };
26 };
27
28 services.dnsmasq.enable = true;
29 services.dnsmasq.settings.server = [ "127.0.0.1#${toString localProxyPort}" ];
30 };
31 };
32
33 testScript = ''
34 client.wait_for_unit("dnsmasq")
35 client.wait_for_unit("dnscrypt-proxy2")
36 client.wait_until_succeeds("ss --numeric --udp --listening | grep -q ${toString localProxyPort}")
37 '';
38})