1import ./make-test.nix ({ pkgs, ... }: {
2 name = "dnscrypt-proxy";
3 meta = with pkgs.stdenv.lib.maintainers; {
4 maintainers = [ joachifm ];
5 };
6
7 nodes = {
8 # A client running the recommended setup: DNSCrypt proxy as a forwarder
9 # for a caching DNS client.
10 client =
11 { config, pkgs, ... }:
12 let localProxyPort = 43; in
13 {
14 security.apparmor.enable = true;
15
16 services.dnscrypt-proxy.enable = true;
17 services.dnscrypt-proxy.localPort = localProxyPort;
18 services.dnscrypt-proxy.extraArgs = [ "-X libdcplugin_example.so" ];
19
20 services.dnsmasq.enable = true;
21 services.dnsmasq.servers = [ "127.0.0.1#${toString localProxyPort}" ];
22 };
23 };
24
25 testScript = ''
26 $client->waitForUnit("dnsmasq");
27
28 # The daemon is socket activated; sending a single ping should activate it.
29 $client->execute("${pkgs.iputils}/bin/ping -c1 example.com");
30 $client->succeed("systemctl is-active dnscrypt-proxy");
31 '';
32})