From 5e3bf6ea5e8fd26bcced2602d24da52ef4d60ab3 Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Sun, 22 Sep 2024 13:11:10 +0300 Subject: [PATCH] feat(system/hosts/dns): add entries for each host --- lib/util.nix | 5 +++++ systems/hosts/dns/default.nix | 30 ++++++++++++++++++------------ 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/lib/util.nix b/lib/util.nix index c02de95..77a74a3 100644 --- a/lib/util.nix +++ b/lib/util.nix @@ -10,5 +10,10 @@ }; getIPv4 = hostName: hostnameIPv4.${hostName}; in { + # hostname.home.arpa = ip + hostnameDNSEntries = + lib.attrsets.mapAttrs' + (name: value: lib.attrsets.nameValuePair (name + ".home.arpa") value) + hostnameIPv4; getIPv4 = getIPv4; } diff --git a/systems/hosts/dns/default.nix b/systems/hosts/dns/default.nix index fb3504c..df9a408 100644 --- a/systems/hosts/dns/default.nix +++ b/systems/hosts/dns/default.nix @@ -1,4 +1,8 @@ -{...}: let +{ + artautil, + lib, + ... +}: let proxyAlias = "proxy.home.arpa"; proxyIP = "10.1.2.10"; @@ -29,21 +33,23 @@ in { }; customDNS = { customTTL = "1h"; - mapping = { - "${proxyAlias}" = proxyIP; + mapping = + { + "${proxyAlias}" = proxyIP; - "dns${rlUrl}" = proxyIP; + "dns${rlUrl}" = proxyIP; - "multi.media${rlUrl}" = proxyIP; - "books.media${rlUrl}" = proxyIP; - "nextcloud${rlUrl}" = proxyIP; + "multi.media${rlUrl}" = proxyIP; + "books.media${rlUrl}" = proxyIP; + "nextcloud${rlUrl}" = proxyIP; - "metrics${rlUrl}" = proxyIP; + "metrics${rlUrl}" = proxyIP; - "portainer${uwUrl}" = proxyIP; - "registry${uwUrl}" = proxyIP; - "registryui${uwUrl}" = proxyIP; - }; + "portainer${uwUrl}" = proxyIP; + "registry${uwUrl}" = proxyIP; + "registryui${uwUrl}" = proxyIP; + } + // artautil.hostnameDNSEntries; }; blocking = { blackLists = { -- 2.44.1