From fce75fde73f0b528bbcbffe6e52255c3d9a724b8 Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Mon, 11 Mar 2024 23:27:09 +0000 Subject: [PATCH] feat: made the custom dns a tad more general --- applications/dns.nix | 2 +- config/dns.nix | 69 ++++++++++++++++++++++++-------------------- 2 files changed, 39 insertions(+), 32 deletions(-) diff --git a/applications/dns.nix b/applications/dns.nix index 2ac25a5..437625d 100644 --- a/applications/dns.nix +++ b/applications/dns.nix @@ -241,7 +241,7 @@ }; records = - config.skynet.records + config.skynet.records."skynet.ie" ++ builtins.concatLists ( lib.attrsets.mapAttrsToList ( key: value: let diff --git a/config/dns.nix b/config/dns.nix index c2306a7..4576c47 100644 --- a/config/dns.nix +++ b/config/dns.nix @@ -8,41 +8,48 @@ options.skynet = { records = lib.mkOption { description = "Records, sorted based on therir type"; - type = lib.types.listOf (lib.types.submodule (import ../_types/dns_object.nix { + type = lib.types.attrsOf (lib.types.listOf (lib.types.submodule (import ../_types/dns_object.nix { inherit lib; - })); + }))); }; }; config = { - skynet.records = [ - { - record = "optimus-reborn"; - r_type = "A"; - value = "193.1.99.90"; - server = true; - } - { - record = "panel.games"; - r_type = "CNAME"; - value = "optimus-reborn"; - } - { - record = "bumblebee"; - r_type = "A"; - value = "193.1.99.91"; - server = true; - } - { - record = "minecraft.compsoc.games"; - r_type = "CNAME"; - value = "bumblebee"; - } - { - record = "_minecraft._tcp.minecraft.compsoc.games.skynet.ie."; - r_type = "SRV"; - value = "0 10 25518 minecraft.compsoc.games.skynet.ie."; - } - ]; + skynet.records = { + "skynet.ie" = [ + { + record = "optimus-reborn2"; + r_type = "A"; + value = "193.1.99.90"; + server = true; + } + { + record = "panel.games"; + r_type = "CNAME"; + value = "optimus-reborn"; + } + { + record = "bumblebee"; + r_type = "A"; + value = "193.1.99.91"; + server = true; + } + { + record = "minecraft.compsoc.games"; + r_type = "CNAME"; + value = "bumblebee"; + } + { + record = "_minecraft._tcp.minecraft.compsoc.games.skynet.ie."; + r_type = "SRV"; + value = "0 10 25518 minecraft.compsoc.games.skynet.ie."; + } + ]; + + + # some space to avoid conflicts + + + }; }; }