feat: I think i got external/non-nixos domains working pretty solidly
This commit is contained in:
parent
a000bcc66d
commit
8e355bab9a
2 changed files with 29 additions and 15 deletions
|
@ -48,8 +48,8 @@
|
||||||
get_config_file = (
|
get_config_file = (
|
||||||
domain: records: ''
|
domain: records: ''
|
||||||
$TTL 60 ; 1 minute
|
$TTL 60 ; 1 minute
|
||||||
; hostmaster@${domain} is an email address that recieves stuff related to dns
|
; hostmaster@skynet.ie is an email address that recieves stuff related to dns
|
||||||
@ IN SOA ${nameserver}.${domain}. hostmaster.${domain}. (
|
@ IN SOA ${nameserver}.skynet.ie. hostmaster.skynet.ie. (
|
||||||
; Serial (YYYYMMDDCC) this has to be updated for each time the record is updated
|
; Serial (YYYYMMDDCC) this has to be updated for each time the record is updated
|
||||||
${current_date}
|
${current_date}
|
||||||
600 ; Refresh (10 minutes)
|
600 ; Refresh (10 minutes)
|
||||||
|
@ -175,6 +175,13 @@
|
||||||
then create_entry_etc_sub domain (text.reverse domain records)
|
then create_entry_etc_sub domain (text.reverse domain records)
|
||||||
else {};
|
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: {
|
create_entry_zone = domain: {
|
||||||
"${domain}" = {
|
"${domain}" = {
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
|
@ -297,21 +304,21 @@ in {
|
||||||
"ip daddr ${cfg.server.ip} udp dport 53 counter packets 0 bytes 0 accept"
|
"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 "csn.ul.ie")
|
||||||
// (create_entry_zone "skynet.ie" )
|
(create_entry_zone "skynet.ie")
|
||||||
// (create_entry_zone "ulcompsoc.ie" )
|
(create_entry_zone "ulcompsoc.ie")
|
||||||
// (create_entry_zone "64-64.99.1.193.in-addr.arpa" )
|
(create_entry_zone "64-64.99.1.193.in-addr.arpa")
|
||||||
// (create_entry_zone "conradcollins.net" )
|
create_entry_zone_attr
|
||||||
// (create_entry_zone "edelharty.net" );
|
];
|
||||||
|
|
||||||
environment.etc =
|
environment.etc = lib.mkMerge [
|
||||||
(create_entry_etc "csn.ul.ie" "owned" records)
|
(create_entry_etc "csn.ul.ie" "owned" records)
|
||||||
// (create_entry_etc "skynet.ie" "owned" records)
|
(create_entry_etc "skynet.ie" "owned" records)
|
||||||
// (create_entry_etc "ulcompsoc.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 "64-64.99.1.193.in-addr.arpa" "reverse" records)
|
||||||
// (create_entry_etc "conradcollins.net" "owned" config.skynet.records."conradcollins.net")
|
create_entry_etc_attr
|
||||||
// (create_entry_etc "edelharty.net" "owned" config.skynet.records."edelharty.net");
|
];
|
||||||
|
|
||||||
# secrets required
|
# secrets required
|
||||||
age.secrets.dns_dnskeys = {
|
age.secrets.dns_dnskeys = {
|
||||||
|
|
|
@ -42,10 +42,17 @@
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
# some space to avoid conflicts
|
# some space to avoid conflicts
|
||||||
"conradcollins.net" = [];
|
"conradcollins.net" = [];
|
||||||
"edelharty.net" = [];
|
"edelharty.net" = [];
|
||||||
|
|
||||||
|
"outinul.ie" = [
|
||||||
|
{
|
||||||
|
record = "@";
|
||||||
|
r_type = "CNAME";
|
||||||
|
value = "users.skynet.ie.";
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue