summaryrefslogtreecommitdiffstats
path: root/nixos/tests/dnscrypt-proxy2.nix
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@protonmail.ch>2020-02-01 18:59:02 -0500
committerworldofpeace <worldofpeace@protonmail.ch>2020-02-02 21:51:19 -0500
commit4c3166b0065b950db7719013fd193609896c2867 (patch)
treeebf9c7b266e0b07bd18c924fb8f07e41c19d1faf /nixos/tests/dnscrypt-proxy2.nix
parent915060d03f1a9f98e934cd779af90e3273ff91e3 (diff)
nixosTests.dnscrypt-proxy2: init
This removes the old dnscrypt-proxy test.
Diffstat (limited to 'nixos/tests/dnscrypt-proxy2.nix')
-rw-r--r--nixos/tests/dnscrypt-proxy2.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/nixos/tests/dnscrypt-proxy2.nix b/nixos/tests/dnscrypt-proxy2.nix
new file mode 100644
index 000000000000..b614d912a9f4
--- /dev/null
+++ b/nixos/tests/dnscrypt-proxy2.nix
@@ -0,0 +1,36 @@
+import ./make-test-python.nix ({ pkgs, ... }: {
+ name = "dnscrypt-proxy2";
+ 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 =
+ { ... }:
+ let localProxyPort = 43; in
+ {
+ security.apparmor.enable = true;
+
+ services.dnscrypt-proxy2.enable = true;
+ services.dnscrypt-proxy2.settings = {
+ listen_addresses = [ "127.0.0.1:${toString localProxyPort}" ];
+ sources.public-resolvers = {
+ urls = [ "https://download.dnscrypt.info/resolvers-list/v2/public-resolvers.md" ];
+ cache_file = "public-resolvers.md";
+ minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3";
+ refresh_delay = 72;
+ };
+ };
+
+ services.dnsmasq.enable = true;
+ services.dnsmasq.servers = [ "127.0.0.1#${toString localProxyPort}" ];
+ };
+ };
+
+ testScript = ''
+ client.wait_for_unit("dnsmasq")
+ client.wait_for_unit("dnscrypt-proxy2")
+ '';
+})