commit 4bb50d8e73b71e3022e76c26e07811c2718bcd3c Author: Adithya Nair Date: Fri Nov 8 10:11:43 2024 +0530 initial commit diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..c4b17d7 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use_flake diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..efc99e0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +creds.json diff --git a/dnsconfig.js b/dnsconfig.js new file mode 100644 index 0000000..df31058 --- /dev/null +++ b/dnsconfig.js @@ -0,0 +1,81 @@ +// @ts-check +/// + +var REG_DYNADOT = NewRegistrar("dynadot"); +var DNSP_HETZNER = NewDnsProvider("hetzner"); + +D("ironyofprivacy.org", REG_DYNADOT, DnsProvider(DNSP_HETZNER), + MX("@", 10, "in1-smtp.messagingengine.com."), + MX("@", 20, "in2-smtp.messagingengine.com."), + CNAME("mesmtp._domainkey", "mesmtp.ironyofprivacy.org.dkim.fmhosted.com."), + CNAME("fm1._domainkey", "fm1.ironyofprivacy.org.dkim.fmhosted.com."), + CNAME("fm2._domainkey", "fm2.ironyofprivacy.org.dkim.fmhosted.com."), + CNAME("fm3._domainkey", "fm3.ironyofprivacy.org.dkim.fmhosted.com."), + SRV("_submission._tcp", 0,0,0,"."), + SRV("_imap._tcp", 0,0,0,"."), + SRV("_pop3._tcp", 0,0,0,"."), + SRV("_submissions._tcp", 0,1,465,"smtp.fastmail.com."), + SRV("_imaps._tcp", 0,1,993,"imap.fastmail.com."), + SRV("_pop3s._tcp", 0,1,995,"pop.fastmail.com."), + SRV("_jmap._tcp", 0,1,443,"api.fastmail.com."), + SRV("_carddav._tcp", 0,0,0,"."), + SRV("_carddavs._tcp", 0,1,443,"carddav.fastmail.com."), + SRV("_caldav._tcp", 0,0,0,"."), + SRV("_caldavs._tcp", 0,1,443,"caldav.fastmail.com."), + SRV("_autodiscover._tcp", 0,1,443,"autodiscover.fastmail.com."), + TXT("@", "v=spf1 include:spf.messagingengine.com ?all"), + TXT("_dmarc", "v=DMARC1; p=none;"), +END); + +D("adtya.xyz", REG_DYNADOT, DnsProvider(DSP_HETZNER), + A("@", "165.232.180.97"), + CNAME("if3", "if3.fly.dev."), + CNAME("proofs", "adtya.xyz."), + CNAME("wiki", "adtya.xyz."), + CNAME("www", "adtya.xyz."), + CNAME("mesmtp._domainkey", "mesmtp.adtya.xyz.dkim.fmhosted.com."), + CNAME("fm1._domainkey", "fm1.adtya.xyz.dkim.fmhosted.com."), + CNAME("fm2._domainkey", "fm2.adtya.xyz.dkim.fmhosted.com."), + CNAME("fm3._domainkey", "fm3.adtya.xyz.dkim.fmhosted.com."), + MX("@", 10, "in2-smtp.messagingengine.com."), + MX("@", 10, "in1-smtp.messagingengine.com."), + SRV("_autodiscover._tcp", 0, 1, 443, "autodiscover.fastmail.com."), + SRV("_caldav._tcp", 0, 0, 0, "."), + SRV("_caldavs._tcp", 0, 1, 443, "caldav.fastmail.com."), + SRV("_carddav._tcp", 0, 0, 0, "."), + SRV("_imap._tcp", 0, 0, 0, "."), + SRV("_imaps._tcp", 0, 1, 993, "imap.fastmail.com."), + SRV("_jmap._tcp", 0, 1, 443, "jmap.fastmail.com."), + SRV("_pop3._tcp", 0, 0, 0, "."), + SRV("_pop3s._tcp", 10, 1, 995, "pop.fastmail.com."), + SRV("_submission._tcp", 0, 1, 587, "smtp.fastmail.com."), + TXT("@", "v=spf1 include:spf.messagingengine.com ?all"), + TXT("_dmarc", "v=DMARC1; p=none;"), + TXT("_github-pages-challenge-adtya", "c83b7cfc33c02c0499d401da51b801"), +END); + +D("acomputer.lol", REG_DYNADOT, DnsProvider(DSP_HETZNER), + A("@", "165.232.180.97"), + CNAME("forge", "acomputer.lol."), + CNAME("matrix", "acomputer.lol."), + CNAME("ntfy", "acomputer.lol."), + CNAME("proxy", "acomputer.lol."), + CNAME("www", "acomputer.lol."), + CNAME("mesmtp._domainkey", "mesmtp.acomputer.lol.dkim.fmhosted.com."), + CNAME("fm1._domainkey", "fm1.acomputer.lol.dkim.fmhosted.com."), + CNAME("fm2._domainkey", "fm2.acomputer.lol.dkim.fmhosted.com."), + CNAME("fm3._domainkey", "fm3.acomputer.lol.dkim.fmhosted.com."), + MX("@", 10, "in2-smtp.messagingengine.com."), + MX("@", 10, "in1-smtp.messagingengine.com."), + SRV("_autodiscover._tcp", 0, 1, 443, "autodiscover.fastmail.com."), + SRV("_caldav._tcp", 0, 0, 0, "."), + SRV("_caldavs._tcp", 0, 1, 443, "caldav.fastmail.com."), + SRV("_carddav._tcp", 0, 0, 0, "."), + SRV("_imap._tcp", 0, 0, 0, "."), + SRV("_imaps._tcp", 0, 1, 993, "imap.fastmail.com."), + SRV("_pop3._tcp", 0, 0, 0, "."), + SRV("_pop3s._tcp", 10, 1, 995, "pop.fastmail.com."), + SRV("_submission._tcp", 0, 0, 587, "smtp.fastmail.com."), + TXT("@", "v=spf1 include:spf.messagingengine.com ?all"), + TXT("_dmarc", "v=DMARC1; p=none;"), +END); diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..d6fa272 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1730958623, + "narHash": "sha256-JwQZIGSYnRNOgDDoIgqKITrPVil+RMWHsZH1eE1VGN0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "85f7e662eda4fa3a995556527c87b2524b691933", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..139d6ea --- /dev/null +++ b/flake.nix @@ -0,0 +1,27 @@ +{ + description = "DNS config using DNSControl"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = + { nixpkgs ,flake-utils, ... }: flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = import nixpkgs { + inherit system; + }; + in + { + formatter = pkgs.nixpkgs-fmt; + devShells.default = pkgs.mkShell { + packages = with pkgs; [ + dnscontrol + tailwindcss-language-server + ]; + }; + } + ); +} diff --git a/zones/.gitkeep b/zones/.gitkeep new file mode 100644 index 0000000..e69de29