forked from partofmyid/register
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
32 lines (29 loc) · 919 Bytes
/
Copy pathflake.nix
File metadata and controls
32 lines (29 loc) · 919 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
description = "Zone File Generator For part-of.my.id";
inputs.dns.url = "github:nix-community/dns.nix";
outputs = { dns, ... }: let
email = "admin@satr14.my.id";
domains."0" = {
domain = "part-of.my.id";
nameservers = [
"adele.ns.cloudflare.com"
"fattouche.ns.cloudflare.com"
];
};
in {
packages.x86_64-linux = builtins.mapAttrs (_: domain:
dns.util.x86_64-linux.writeZone domain.domain (
with dns.lib.combinators; {
SOA = {
adminEmail = email;
nameServer = builtins.head domain.nameservers;
serial = builtins.currentTime;
};
NS = domain.nameservers;
# note: Cloudflare ignores SOA and NS records uploaded via Zone File, they are just so that dns.nix builds a valid zone file.
A = [ "1.1.1.1" ];
}
)
) domains;
};
}