diff options
| author | Isabella Bastaja <isabella@sorre.xyz> | 2026-05-31 23:17:31 +0200 |
|---|---|---|
| committer | Isabella Bastaja <isabella@sorre.xyz> | 2026-06-04 17:08:37 +0200 |
| commit | 721f7b6aecfb35694151c9c0e610f895171d202b (patch) | |
| tree | 4e5d992e10cdf01f8bbc8637308ecd44f466b17c /wireguard.nix | |
| parent | bef4a2595033a9e093214b252bb65bb8ca064211 (diff) | |
sagittarius: set up authoritative DNS server for sorre.internal
Diffstat (limited to 'wireguard.nix')
| -rw-r--r-- | wireguard.nix | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/wireguard.nix b/wireguard.nix index 8709647..b26d13a 100644 --- a/wireguard.nix +++ b/wireguard.nix @@ -8,6 +8,9 @@ let wgPort = 51820; # Common port used on all peers firewallMark = 42; + # The topology is hub-and-spoke/star + # sagittarius is the hub == 2301:db8:acad:a::1 + # it hosts authoritative DNS and spokes do keepalive with it. hosts = { sagittarius = { address = "2301:db8:acad:a::1/128"; @@ -33,14 +36,14 @@ let }; generatedPeers = lib.attrsets.mapAttrsToList generatePeer peers; - stripNetmask = addr: lib.strings.removeSuffix "/128" addr; - generatedHosts = lib.attrsets.mapAttrs' (hostname: value: { - name = stripNetmask value.address; - value = [ - hostname - "${hostname}.internal" - ]; - }) peers; + # stripNetmask = addr: lib.strings.removeSuffix "/128" addr; + # generatedHosts = lib.attrsets.mapAttrs' (hostname: value: { + # name = stripNetmask value.address; + # value = [ + # hostname + # "${hostname}.internal" + # ]; + # }) peers; in { sops.secrets."wireguard-${hostname}-pk" = { @@ -51,7 +54,10 @@ in format = "binary"; }; - networking.hosts = generatedHosts; + networking.nameservers = [ + "2301:db8:acad:a::1" # see the zonefile in etc/dns + ]; + systemd.network = { enable = true; |
