summary refs log tree commit diff
path: root/nixos/tests/dnscrypt-proxy.nix
diff options
context:
space:
mode:
authorrnhmjoj <rnhmjoj@inventati.org>2018-01-08 15:09:33 +0100
committerrnhmjoj <rnhmjoj@inventati.org>2018-01-08 15:09:33 +0100
commit4ebb9621f44bf440ed8f35fc3ec3329840139136 (patch)
tree795c0cf97d64d004e52ee91f93556c60fca4055e /nixos/tests/dnscrypt-proxy.nix
parent9dcb4b40b01ea25f1fcefeb45da922c5a2a60698 (diff)
downloadnixlib-4ebb9621f44bf440ed8f35fc3ec3329840139136.tar
nixlib-4ebb9621f44bf440ed8f35fc3ec3329840139136.tar.gz
nixlib-4ebb9621f44bf440ed8f35fc3ec3329840139136.tar.bz2
nixlib-4ebb9621f44bf440ed8f35fc3ec3329840139136.tar.lz
nixlib-4ebb9621f44bf440ed8f35fc3ec3329840139136.tar.xz
nixlib-4ebb9621f44bf440ed8f35fc3ec3329840139136.tar.zst
nixlib-4ebb9621f44bf440ed8f35fc3ec3329840139136.zip
Revert "nixos/dnscrypt-proxy: remove"
This reverts commit 5dc2853981b6e9287668dd17477375adfeb60ebf.
The project has a new maintainer.
Diffstat (limited to 'nixos/tests/dnscrypt-proxy.nix')
-rw-r--r--nixos/tests/dnscrypt-proxy.nix32
1 files changed, 32 insertions, 0 deletions
diff --git a/nixos/tests/dnscrypt-proxy.nix b/nixos/tests/dnscrypt-proxy.nix
new file mode 100644
index 000000000000..845623368250
--- /dev/null
+++ b/nixos/tests/dnscrypt-proxy.nix
@@ -0,0 +1,32 @@
+import ./make-test.nix ({ pkgs, ... }: {
+  name = "dnscrypt-proxy";
+  meta = with pkgs.stdenv.lib.maintainers; {
+    maintainers = [ joachifm ];
+  };
+
+  nodes = {
+    # A client running the recommended setup: DNSCrypt proxy as a forwarder
+    # for a caching DNS client.
+    client =
+    { config, pkgs, ... }:
+    let localProxyPort = 43; in
+    {
+      security.apparmor.enable = true;
+
+      services.dnscrypt-proxy.enable = true;
+      services.dnscrypt-proxy.localPort = localProxyPort;
+      services.dnscrypt-proxy.extraArgs = [ "-X libdcplugin_example.so" ];
+
+      services.dnsmasq.enable = true;
+      services.dnsmasq.servers = [ "127.0.0.1#${toString localProxyPort}" ];
+    };
+  };
+
+  testScript = ''
+    $client->waitForUnit("dnsmasq");
+
+    # The daemon is socket activated; sending a single ping should activate it.
+    $client->execute("${pkgs.iputils}/bin/ping -c1 example.com");
+    $client->succeed("systemctl is-active dnscrypt-proxy");
+  '';
+})