summary refs log tree commit diff stats
path: root/system/modules/nextdns.nix
diff options
context:
space:
mode:
authorAlan Pearce2020-09-10 14:57:15 +0200
committerAlan Pearce2020-09-10 14:57:15 +0200
commit57250f8deeffb892cb45a0850f0ab6ee07ccaee4 (patch)
tree81c7b4f51fa184b9fdc2b865d93c8b7a2380223c /system/modules/nextdns.nix
parente9e9d0be07e91b4bb2191ad5f653e66d4f986677 (diff)
downloadnixfiles-57250f8deeffb892cb45a0850f0ab6ee07ccaee4.tar.lz
nixfiles-57250f8deeffb892cb45a0850f0ab6ee07ccaee4.tar.zst
nixfiles-57250f8deeffb892cb45a0850f0ab6ee07ccaee4.zip
nextdns: remove darwin support
Use nextdns CLI instead
Diffstat (limited to 'system/modules/nextdns.nix')
-rw-r--r--system/modules/nextdns.nix44
1 files changed, 4 insertions, 40 deletions
diff --git a/system/modules/nextdns.nix b/system/modules/nextdns.nix
index 830215e6..021c65d3 100644
--- a/system/modules/nextdns.nix
+++ b/system/modules/nextdns.nix
@@ -20,22 +20,6 @@ let
       })))
     '';
   };
-
-  stubbyConfig = {
-    enable = true;
-    fallbackProtocols = lib.mkDefault [ "GETDNS_TRANSPORT_TLS" ];
-    roundRobinUpstreams = lib.mkDefault false;
-    upstreamServers = ''
-      - address_data: 45.90.28.0
-        tls_auth_name: "${identifyingPrefix}${cfg.configID}.dns1.nextdns.io"
-      - address_data: 2a07:a8c0::0
-        tls_auth_name: "${identifyingPrefix}${cfg.configID}.dns1.nextdns.io"
-      - address_data: 45.90.30.0
-        tls_auth_name: "${identifyingPrefix}${cfg.configID}.dns2.nextdns.io"
-      - address_data: 2a07:a8c1::0
-        tls_auth_name: "${identifyingPrefix}${cfg.configID}.dns2.nextdns.io"
-    '';
-  };
 in
 {
   options = {
@@ -57,40 +41,20 @@ in
       default = false;
       description = "Whether to send hostname for identifying in your logs";
     };
-
-    networking.nextdns.resolver = mkOption {
-      type = types.enum [ "kresd" "stubby" ];
-      default = if stdenv.isDarwin then "stubby" else "kresd";
-      description = "Resolver to use";
-    };
   };
 
   config = mkIf cfg.enable {
 
     assertions = [
       {
-        assertion = !(stdenv.isDarwin && cfg.resolver == "kresd");
-        message = "kresd is not supported on Darwin";
+        assertion = !(stdenv.isDarwin);
+        message = "NextDNS module is not supported on Darwin";
       }
     ];
-    networking = if stdenv.isDarwin then
-    {
-      dns = [
-        "::1"
-        "127.0.0.1"
-        "2a07:a8c0::ab:d6e5"
-        "2a07:a8c1::ab:d6e5"
-        "45.90.28.25"
-        "45.90.30.25"
-      ];
-    } else {
+    networking = {
       networkmanager.dns = "none";
       resolvconf.useLocalResolver = true;
     };
-    services = {
-      stubby = mkIf (cfg.resolver == "stubby") stubbyConfig;
-    } // mkIf (!stdenv.isDarwin) {
-      kresd = mkIf (cfg.resolver == "kresd") kresdConfig;
-    };
+    services.kresd = kresdConfig;
   };
 }