Commit 59a029d

HPCesia <me@hpcesia.com>
2026-07-12 13:12:23
Use host instead of Tailscale split DNS for hostname resolve
1 parent 7e1c508
Changed files (1)
modules
modules/core/tailscale.nix
@@ -1,4 +1,8 @@
 {
+  den,
+  lib,
+  ...
+}: {
   den.aspects.core.tailscale = {
     persist = {
       directories = [
@@ -10,6 +14,7 @@
     };
 
     nixos = {
+      host,
       config,
       pkgs,
       ...
@@ -20,10 +25,16 @@
         enable = true;
         extraUpFlags = [
           "--login-server=https://gate.trin.one"
-          "--accept-dns=true"
         ];
       };
 
+      networking.hosts = lib.concatMapAttrs (hostname: {address, ...}:
+        lib.optionalAttrs (hostname != host.name) {
+          ${address.ipv4.tailscale} = [hostname];
+          ${address.ipv6.tailscale} = [hostname];
+        })
+      (lib.mergeAttrsList (lib.attrValues den.hosts));
+
       networking.firewall = {
         trustedInterfaces = [config.services.tailscale.interfaceName];
         allowedUDPPorts = [config.services.tailscale.port];