From f08f83e5c79a29c29fa41ac0125efd75ef016700 Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Tue, 17 Jan 2023 23:31:47 +0000 Subject: [PATCH] feat: vendetta roughly set up for dns --- machines/vendetta.nix | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/machines/vendetta.nix b/machines/vendetta.nix index 3d5a41f..21ce467 100644 --- a/machines/vendetta.nix +++ b/machines/vendetta.nix @@ -18,11 +18,19 @@ let # hostname = "vendetta.skynet.ie"; hostname = "test01.home.brendan.ie"; - + # this server will have to have dns records + own = { + external = [ + "vendetta A ${ip_pub}" + ]; + cname = [ + #"misc CNAME vendetta" + ]; + }; in { imports = [ # applications for this particular server - + ../applications/dns.nix ]; deployment = { @@ -31,6 +39,27 @@ in { targetUser = "root"; }; + skynet_dns = { + enable = true; + records = { + # using the same logic as the firewall, comments there + external = builtins.concatLists ( + lib.attrsets.mapAttrsToList (key: value: + if value.config.deployment.hostname == hostname + then own.external + else value.config.skynet_dns.records.external + ) nodes + ); + + cname = builtins.concatLists ( + lib.attrsets.mapAttrsToList (key: value: + if value.config.deployment.hostname == hostname + then own.cname + else value.config.skynet_dns.records.cname + ) nodes + ); + }; + }; }