Skip to content

Commit 1fd3919

Browse files
authored
Merge pull request #99 from momeemt/config/2025-11-18-6d050e5a-1488-4f65-9932-a8e7b61dfac7
2 parents bc7e6bc + 322a01e commit 1fd3919

File tree

8 files changed

+325
-5
lines changed

8 files changed

+325
-5
lines changed

nix/flakes/per-system.nix

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44
config,
55
system,
66
...
7-
}: {
7+
}: let
8+
pkgs-master = import inputs.nixpkgs-master {
9+
inherit system;
10+
config.allowUnfree = true;
11+
};
12+
in {
813
_module.args.pkgs = import inputs.nixpkgs {
914
inherit system;
1015
config.allowUnfree = true;
@@ -20,7 +25,9 @@
2025
];
2126
buildInputs = with pkgs; [
2227
sops
23-
terraform
28+
pkgs-master.terraform
29+
pkgs-master.terraform-providers.cloudflare_cloudflare
30+
pkgs-master.terraform-providers.carlpett_sops
2431
nodejs_24
2532
];
2633
};
@@ -69,6 +76,7 @@
6976
};
7077
statix.enable = true;
7178
stylua.enable = true;
79+
terraform.enable = true;
7280
yamlfmt.enable = true;
7381
};
7482
settings.global.excludes = [

nix/home/example/default.nix

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
{inputs, ...}: {
1+
{
2+
inputs,
3+
pkgs,
4+
...
5+
}: {
26
imports = [
37
inputs.nixvim.homeManagerModules.nixvim
48
../../modules/nixvim
@@ -9,6 +13,7 @@
913
../../modules/site/home
1014
];
1115

16+
nix.package = pkgs.nix;
1217
site.home.username = "example";
1318
programs.home-manager.enable = true;
1419
}

secrets/secrets.enc.yml

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

terraform/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.terraform/*
2+
*.tfstate
3+
*.tfstate.*

terraform/.terraform.lock.hcl

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

terraform/cloudflare.tf

Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
provider "cloudflare" {
2+
api_token = local.cloudflare_api_token
3+
}
4+
5+
resource "cloudflare_dns_record" "www_dns_record" {
6+
zone_id = local.cloudflare_zone_id
7+
name = "www"
8+
type = "CNAME"
9+
content = "momee.mt"
10+
ttl = 1
11+
proxied = true
12+
comment = "www.momee.mt"
13+
}
14+
15+
resource "cloudflare_dns_record" "root_dns_record" {
16+
zone_id = local.cloudflare_zone_id
17+
name = "momee.mt"
18+
type = "CNAME"
19+
content = "momeemt.github.io"
20+
ttl = 1
21+
proxied = false
22+
comment = "https://github.com/momeemt/momee.mt"
23+
}
24+
25+
resource "cloudflare_dns_record" "blog_dns_record" {
26+
zone_id = local.cloudflare_zone_id
27+
name = "blog"
28+
type = "CNAME"
29+
content = "blog-momee-mt.pages.dev"
30+
ttl = 1
31+
proxied = true
32+
comment = "https://github.com/momeemt/blog.momee.mt"
33+
}
34+
35+
resource "cloudflare_dns_record" "wascaml_dns_record" {
36+
zone_id = local.cloudflare_zone_id
37+
name = "wascaml"
38+
type = "CNAME"
39+
content = "momeemt.github.io"
40+
ttl = 1
41+
proxied = false
42+
comment = "https://github.com/momeemt/wascaml"
43+
}
44+
45+
resource "cloudflare_dns_record" "note_dns_record" {
46+
zone_id = local.cloudflare_zone_id
47+
name = "note"
48+
type = "CNAME"
49+
content = "momeemt.github.io"
50+
ttl = 1
51+
proxied = false
52+
comment = "https://github.com/momeemt/note.momee.mt"
53+
}
54+
55+
resource "cloudflare_dns_record" "beta_blog_dns_record" {
56+
zone_id = local.cloudflare_zone_id
57+
name = "beta.blog"
58+
type = "CNAME"
59+
content = "cname.vercel-dns.com"
60+
ttl = 1
61+
proxied = false
62+
comment = "https://github.com/momeemt/beta.blog.momee.mt"
63+
}
64+
65+
resource "cloudflare_dns_record" "discord_verification" {
66+
zone_id = local.cloudflare_zone_id
67+
name = "_discord"
68+
type = "TXT"
69+
content = "\"dh=2e77ca64445ab63e1f162fcac219561b3c130875\""
70+
ttl = 1
71+
comment = "Discord domain verification"
72+
}
73+
74+
resource "cloudflare_dns_record" "keybase_verification" {
75+
zone_id = local.cloudflare_zone_id
76+
name = "momee.mt"
77+
type = "TXT"
78+
content = "\"keybase-site-verification=uFhhJXlVtYpXOJu1UUm-CLj_z6YwIa1nKAe40aJez6s\""
79+
ttl = 1
80+
comment = "Keybase domain verification"
81+
}
82+
83+
resource "cloudflare_dns_record" "openai_verification" {
84+
zone_id = local.cloudflare_zone_id
85+
name = "openai"
86+
type = "TXT"
87+
content = "\"openai-domain-verification=dv-kKZVqBQ4A8qyubcbqOpsFWEh\""
88+
ttl = 1
89+
comment = "OpenAI domain verification"
90+
}
91+
92+
resource "cloudflare_dns_record" "google_site_verification_1" {
93+
zone_id = local.cloudflare_zone_id
94+
name = "google-site-verification"
95+
type = "TXT"
96+
content = "\"google-site-verification=lJLyU_Pwc5FLoSU3BfswBFEwuovJlgUlwCP8W1_Su-I\""
97+
ttl = 1
98+
comment = "Google site verification 1"
99+
}
100+
101+
resource "cloudflare_dns_record" "google_site_verification_2" {
102+
zone_id = local.cloudflare_zone_id
103+
name = "google-site-verification"
104+
type = "TXT"
105+
content = "\"google-site-verification=nrsbgKT0ypYdJ5Q0jNJi9pc52dWOL_w1jrw38Xf8AUo\""
106+
ttl = 1
107+
comment = "Google site verification 2"
108+
}
109+
110+
resource "cloudflare_dns_record" "gmail_mx_records_1" {
111+
zone_id = local.cloudflare_zone_id
112+
name = "momee.mt"
113+
type = "MX"
114+
priority = 1
115+
content = "aspmx.l.google.com"
116+
ttl = 3600
117+
comment = "Gmail MX record 1"
118+
}
119+
120+
resource "cloudflare_dns_record" "gmail_mx_records_2" {
121+
zone_id = local.cloudflare_zone_id
122+
name = "momee.mt"
123+
type = "MX"
124+
priority = 5
125+
content = "alt1.aspmx.l.google.com"
126+
ttl = 3600
127+
comment = "Gmail MX record 2"
128+
}
129+
130+
resource "cloudflare_dns_record" "gmail_mx_records_3" {
131+
zone_id = local.cloudflare_zone_id
132+
name = "momee.mt"
133+
type = "MX"
134+
priority = 5
135+
content = "alt2.aspmx.l.google.com"
136+
ttl = 3600
137+
comment = "Gmail MX record 3"
138+
}
139+
140+
resource "cloudflare_dns_record" "gmail_mx_records_4" {
141+
zone_id = local.cloudflare_zone_id
142+
name = "momee.mt"
143+
type = "MX"
144+
priority = 10
145+
content = "alt3.aspmx.l.google.com"
146+
ttl = 3600
147+
comment = "Gmail MX record 4"
148+
}
149+
150+
resource "cloudflare_dns_record" "gmail_mx_records_5" {
151+
zone_id = local.cloudflare_zone_id
152+
name = "momee.mt"
153+
type = "MX"
154+
priority = 10
155+
content = "alt4.aspmx.l.google.com"
156+
ttl = 3600
157+
comment = "Gmail MX record 5"
158+
}
159+
160+
resource "cloudflare_dns_record" "dmarc_record" {
161+
zone_id = local.cloudflare_zone_id
162+
name = "_dmarc"
163+
type = "TXT"
164+
content = "\"v=DMARC1; p=none; rua=mailto:[email protected]\""
165+
ttl = 1
166+
comment = "Generated by Cloudflare for DMARC"
167+
}
168+
169+
resource "cloudflare_dns_record" "bluesky_verification" {
170+
zone_id = local.cloudflare_zone_id
171+
name = "_atproto"
172+
type = "TXT"
173+
content = "\"did=did:plc:w5ccyes44tjzyfza56uffbfz\""
174+
ttl = 1
175+
comment = "Bluesky domain verification"
176+
}
177+
178+
resource "cloudflare_dns_record" "sendgrid_link_branding_1" {
179+
zone_id = local.cloudflare_zone_id
180+
name = "39108174"
181+
type = "CNAME"
182+
content = "sendgrid.net"
183+
ttl = 1
184+
proxied = false
185+
comment = "SendGrid Link Branding 1"
186+
}
187+
188+
resource "cloudflare_dns_record" "sendgrid_link_branding_2" {
189+
zone_id = local.cloudflare_zone_id
190+
name = "url5751"
191+
type = "CNAME"
192+
content = "sendgrid.net"
193+
ttl = 1
194+
proxied = false
195+
comment = "SendGrid Link Branding 2"
196+
}
197+
198+
resource "cloudflare_dns_record" "sendgrid_domain_authentication_dkim_1" {
199+
zone_id = local.cloudflare_zone_id
200+
name = "s1._domainkey"
201+
type = "CNAME"
202+
content = "s1.domainkey.u39108174.wl175.sendgrid.net"
203+
ttl = 1
204+
proxied = false
205+
comment = "SendGrid Domain Authentication DKIM 1"
206+
}
207+
208+
resource "cloudflare_dns_record" "sendgrid_domain_authentication_dkim_2" {
209+
zone_id = local.cloudflare_zone_id
210+
name = "s2._domainkey"
211+
type = "CNAME"
212+
content = "s2.domainkey.u39108174.wl175.sendgrid.net"
213+
ttl = 1
214+
proxied = false
215+
comment = "SendGrid Domain Authentication DKIM 2"
216+
}
217+
218+
resource "cloudflare_dns_record" "sendgrid_domain_authentication_spf" {
219+
zone_id = local.cloudflare_zone_id
220+
name = "em40"
221+
type = "CNAME"
222+
content = "u39108174.wl175.sendgrid.net"
223+
ttl = 1
224+
proxied = false
225+
comment = "SendGrid Domain Authentication SPF"
226+
}
227+
228+
resource "cloudflare_dns_record" "calendly_dns_record" {
229+
zone_id = local.cloudflare_zone_id
230+
name = "calendly"
231+
type = "A"
232+
content = "192.0.2.1"
233+
ttl = 1
234+
proxied = true
235+
comment = "https://calendly.com/momeemt/"
236+
}

terraform/sops.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
provider "sops" {}
2+
3+
data "sops_file" "secrets" {
4+
source_file = "../secrets/secrets.enc.yml"
5+
}
6+
7+
locals {
8+
cloudflare_api_token = data.sops_file.secrets.data["cloudflare_api_token"]
9+
cloudflare_zone_id = data.sops_file.secrets.data["cloudflare_zone_id"]
10+
}

terraform/terraform.tf

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
terraform {
2+
required_version = "1.13.5"
3+
4+
required_providers {
5+
cloudflare = {
6+
source = "cloudflare/cloudflare"
7+
version = "5.12.0"
8+
}
9+
10+
sops = {
11+
source = "carlpett/sops"
12+
version = "1.3.0"
13+
}
14+
}
15+
16+
cloud {
17+
organization = "momeemt"
18+
workspaces {
19+
name = "config"
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)