feat: I think i got external/non-nixos domains working pretty solidly

This commit is contained in:
silver 2024-03-12 00:59:02 +00:00
parent a000bcc66d
commit 8e355bab9a
2 changed files with 29 additions and 15 deletions

View file

@ -48,8 +48,8 @@
get_config_file = (
domain: records: ''
$TTL 60 ; 1 minute
; hostmaster@${domain} is an email address that recieves stuff related to dns
@ IN SOA ${nameserver}.${domain}. hostmaster.${domain}. (
; hostmaster@skynet.ie is an email address that recieves stuff related to dns
@ IN SOA ${nameserver}.skynet.ie. hostmaster.skynet.ie. (
; Serial (YYYYMMDDCC) this has to be updated for each time the record is updated
${current_date}
600 ; Refresh (10 minutes)
@ -175,6 +175,13 @@
then create_entry_etc_sub domain (text.reverse domain records)
else {};
create_entry_zone_names = builtins.attrNames (removeAttrs config.skynet.records ["skynet.ie"]);
create_entry_zone_mapped = map (x: (create_entry_zone x)) create_entry_zone_names;
create_entry_zone_attr = lib.mkMerge create_entry_zone_mapped;
create_entry_etc_mapped = map (x: (create_entry_etc x "owned" config.skynet.records.${x})) create_entry_zone_names;
create_entry_etc_attr = lib.mkMerge create_entry_etc_mapped;
create_entry_zone = domain: {
"${domain}" = {
extraConfig = ''
@ -297,21 +304,21 @@ in {
"ip daddr ${cfg.server.ip} udp dport 53 counter packets 0 bytes 0 accept"
];
services.bind.zones =
services.bind.zones = lib.mkMerge [
(create_entry_zone "csn.ul.ie")
// (create_entry_zone "skynet.ie" )
// (create_entry_zone "ulcompsoc.ie" )
// (create_entry_zone "64-64.99.1.193.in-addr.arpa" )
// (create_entry_zone "conradcollins.net" )
// (create_entry_zone "edelharty.net" );
(create_entry_zone "skynet.ie")
(create_entry_zone "ulcompsoc.ie")
(create_entry_zone "64-64.99.1.193.in-addr.arpa")
create_entry_zone_attr
];
environment.etc =
environment.etc = lib.mkMerge [
(create_entry_etc "csn.ul.ie" "owned" records)
// (create_entry_etc "skynet.ie" "owned" records)
// (create_entry_etc "ulcompsoc.ie" "owned" records)
// (create_entry_etc "64-64.99.1.193.in-addr.arpa" "reverse" records)
// (create_entry_etc "conradcollins.net" "owned" config.skynet.records."conradcollins.net")
// (create_entry_etc "edelharty.net" "owned" config.skynet.records."edelharty.net");
(create_entry_etc "skynet.ie" "owned" records)
(create_entry_etc "ulcompsoc.ie" "owned" records)
(create_entry_etc "64-64.99.1.193.in-addr.arpa" "reverse" records)
create_entry_etc_attr
];
# secrets required
age.secrets.dns_dnskeys = {

View file

@ -42,10 +42,17 @@
}
];
# some space to avoid conflicts
"conradcollins.net" = [];
"edelharty.net" = [];
"outinul.ie" = [
{
record = "@";
r_type = "CNAME";
value = "users.skynet.ie.";
}
];
};
};
}