summaryrefslogtreecommitdiff
path: root/hosts/saklas/default.nix
diff options
context:
space:
mode:
authorvin <vin@vineetk.net>2025-05-07 17:00:14 -0400
committervin <vin@vineetk.net>2025-05-07 17:44:33 -0400
commit1ccc0f2c368f35d3082e4b7cef5789f40a6e1bfe (patch)
tree3284daaf6c634b58bf553ed79f0641c4b7158292 /hosts/saklas/default.nix
parent208827b8f8a37fc8bc148c7b0e18791a78cd0cc9 (diff)
run nixfmt
Diffstat (limited to 'hosts/saklas/default.nix')
-rw-r--r--hosts/saklas/default.nix158
1 files changed, 108 insertions, 50 deletions
diff --git a/hosts/saklas/default.nix b/hosts/saklas/default.nix
index 0ea3474..bd738ca 100644
--- a/hosts/saklas/default.nix
+++ b/hosts/saklas/default.nix
@@ -1,4 +1,10 @@
1{ config, lib, pkgs, inputs, ... }: 1{
2 config,
3 lib,
4 pkgs,
5 inputs,
6 ...
7}:
2 8
3{ 9{
4 imports = [ 10 imports = [
@@ -38,8 +44,17 @@
38 wireless.enable = false; 44 wireless.enable = false;
39 45
40 firewall = { 46 firewall = {
41 allowedTCPPorts = [ 22 80 443 5222 5269 ]; 47 allowedTCPPorts = [
42 allowedUDPPorts = [ 3478 51820 ]; 48 22
49 80
50 443
51 5222
52 5269
53 ];
54 allowedUDPPorts = [
55 3478
56 51820
57 ];
43 }; 58 };
44 }; 59 };
45 60
@@ -52,10 +67,16 @@
52 "95.217.18.52/32" 67 "95.217.18.52/32"
53 "2a01:4f9:c010:a653::1/64" 68 "2a01:4f9:c010:a653::1/64"
54 ]; 69 ];
55 dns = [ "185.12.64.1" "185.12.64.2" ]; 70 dns = [
71 "185.12.64.1"
72 "185.12.64.2"
73 ];
56 routes = [ 74 routes = [
57 { Destination = "172.31.1.1"; } 75 { Destination = "172.31.1.1"; }
58 { Gateway = "172.31.1.1"; GatewayOnLink = true; } 76 {
77 Gateway = "172.31.1.1";
78 GatewayOnLink = true;
79 }
59 ]; 80 ];
60 }; 81 };
61 }; 82 };
@@ -70,7 +91,10 @@
70 }; 91 };
71 92
72 # enable flakes and nix cli 93 # enable flakes and nix cli
73 nix.settings.experimental-features = [ "nix-command" "flakes" ]; 94 nix.settings.experimental-features = [
95 "nix-command"
96 "flakes"
97 ];
74 98
75 # user accounts 99 # user accounts
76 users.users.root.openssh.authorizedKeys.keys = [ 100 users.users.root.openssh.authorizedKeys.keys = [
@@ -133,7 +157,11 @@
133 157
134 "xmpp.vineetk.net" = { 158 "xmpp.vineetk.net" = {
135 group = config.services.prosody.group; 159 group = config.services.prosody.group;
136 extraDomainNames = [ "vineetk.net" "muc.vineetk.net" "u.vineetk.net" ]; 160 extraDomainNames = [
161 "vineetk.net"
162 "muc.vineetk.net"
163 "u.vineetk.net"
164 ];
137 reloadServices = [ "prosody" ]; 165 reloadServices = [ "prosody" ];
138 }; 166 };
139 }; 167 };
@@ -142,11 +170,13 @@
142 # I prefer doas over sudo for simplicity 170 # I prefer doas over sudo for simplicity
143 doas = { 171 doas = {
144 enable = true; 172 enable = true;
145 extraRules = [{ 173 extraRules = [
146 users = [ "vin" ]; 174 {
147 keepEnv = true; 175 users = [ "vin" ];
148 persist = true; 176 keepEnv = true;
149 }]; 177 persist = true;
178 }
179 ];
150 }; 180 };
151 181
152 sudo.enable = false; 182 sudo.enable = false;
@@ -169,12 +199,36 @@
169 dns = { 199 dns = {
170 base_domain = "epistemia"; 200 base_domain = "epistemia";
171 extra_records = [ 201 extra_records = [
172 { name = "invidious.demiurge.epistemia"; type = "A"; value = "100.64.0.2"; } 202 {
173 { name = "llm.demiurge.epistemia"; type = "A"; value = "100.64.0.2"; } 203 name = "invidious.demiurge.epistemia";
174 { name = "navidrome.demiurge.epistemia"; type = "A"; value = "100.64.0.2"; } 204 type = "A";
175 { name = "redlib.demiurge.epistemia"; type = "A"; value = "100.64.0.2"; } 205 value = "100.64.0.2";
176 { name = "sdui.demiurge.epistemia"; type = "A"; value = "100.64.0.2"; } 206 }
177 { name = "searx.demiurge.epistemia"; type = "A"; value = "100.64.0.2"; } 207 {
208 name = "llm.demiurge.epistemia";
209 type = "A";
210 value = "100.64.0.2";
211 }
212 {
213 name = "navidrome.demiurge.epistemia";
214 type = "A";
215 value = "100.64.0.2";
216 }
217 {
218 name = "redlib.demiurge.epistemia";
219 type = "A";
220 value = "100.64.0.2";
221 }
222 {
223 name = "sdui.demiurge.epistemia";
224 type = "A";
225 value = "100.64.0.2";
226 }
227 {
228 name = "searx.demiurge.epistemia";
229 type = "A";
230 value = "100.64.0.2";
231 }
178 ]; 232 ];
179 }; 233 };
180 logtail.enabled = false; 234 logtail.enabled = false;
@@ -199,7 +253,7 @@
199 ssl.cert = config.security.acme.certs."xmpp.vineetk.net".directory + "/full.pem"; 253 ssl.cert = config.security.acme.certs."xmpp.vineetk.net".directory + "/full.pem";
200 ssl.key = config.security.acme.certs."xmpp.vineetk.net".directory + "/key.pem"; 254 ssl.key = config.security.acme.certs."xmpp.vineetk.net".directory + "/key.pem";
201 255
202 muc = [{ domain = "muc.vineetk.net"; }]; 256 muc = [ { domain = "muc.vineetk.net"; } ];
203 virtualHosts.vineetk = { 257 virtualHosts.vineetk = {
204 domain = "vineetk.net"; 258 domain = "vineetk.net";
205 enabled = true; 259 enabled = true;
@@ -233,7 +287,7 @@
233 locations."/" = { 287 locations."/" = {
234 proxyPass = "http://127.0.0.1:5232/"; 288 proxyPass = "http://127.0.0.1:5232/";
235 extraConfig = '' 289 extraConfig = ''
236 proxy_pass_header Authorization; 290 proxy_pass_header Authorization;
237 ''; 291 '';
238 }; 292 };
239 }; 293 };
@@ -321,52 +375,56 @@
321 mailserver = { 375 mailserver = {
322 enable = true; 376 enable = true;
323 fqdn = "mail.vineetk.net"; 377 fqdn = "mail.vineetk.net";
324 domains = [ "vineetk.net" "vinbiz.ca" "13f0.net" ]; 378 domains = [
379 "vineetk.net"
380 "vinbiz.ca"
381 "13f0.net"
382 ];
325 383
326 # A list of all login accounts. To create the password hashes, use 384 # A list of all login accounts. To create the password hashes, use
327 # nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt' 385 # nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt'
328 loginAccounts = { 386 loginAccounts = {
329 "vineet@vineetk.net" = { 387 "vineet@vineetk.net" = {
330 hashedPasswordFile = config.age.secrets.email_vineetk.path; 388 hashedPasswordFile = config.age.secrets.email_vineetk.path;
331 aliases = ["@vineetk.net"]; 389 aliases = [ "@vineetk.net" ];
332 }; 390 };
333 391
334 "kar@13f0.net" = { 392 "kar@13f0.net" = {
335 hashedPasswordFile = config.age.secrets.email_13f0.path; 393 hashedPasswordFile = config.age.secrets.email_13f0.path;
336 aliases = ["@13f0.net"]; 394 aliases = [ "@13f0.net" ];
337 sieveScript = '' 395 sieveScript = ''
338require [ "fileinto", "mailbox" ]; 396 require [ "fileinto", "mailbox" ];
339 397
340if address :matches [ "to", "cc" ] "announce@openbsd.org" { 398 if address :matches [ "to", "cc" ] "announce@openbsd.org" {
341 fileinto :create "openbsd_announce"; 399 fileinto :create "openbsd_announce";
342 stop; 400 stop;
343} 401 }
344if address :matches [ "to", "cc" ] "arm@openbsd.org" { 402 if address :matches [ "to", "cc" ] "arm@openbsd.org" {
345 fileinto :create "openbsd_arm"; 403 fileinto :create "openbsd_arm";
346 stop; 404 stop;
347} 405 }
348if address :matches [ "to", "cc" ] "misc@openbsd.org" { 406 if address :matches [ "to", "cc" ] "misc@openbsd.org" {
349 fileinto :create "openbsd_misc"; 407 fileinto :create "openbsd_misc";
350 stop; 408 stop;
351} 409 }
352if address :matches [ "to", "cc" ] "misc@opensmtpd.org" { 410 if address :matches [ "to", "cc" ] "misc@opensmtpd.org" {
353 fileinto :create "opensmtpd_misc"; 411 fileinto :create "opensmtpd_misc";
354 stop; 412 stop;
355} 413 }
356if address :matches [ "to", "cc" ] "oss-security@lists.openwall.com" { 414 if address :matches [ "to", "cc" ] "oss-security@lists.openwall.com" {
357 fileinto :create "oss_security"; 415 fileinto :create "oss_security";
358 stop; 416 stop;
359} 417 }
360if address :matches [ "to", "cc" ] "tuhs@tuhs.org" { 418 if address :matches [ "to", "cc" ] "tuhs@tuhs.org" {
361 fileinto :create "tuhs"; 419 fileinto :create "tuhs";
362 stop; 420 stop;
363} 421 }
364 ''; 422 '';
365 }; 423 };
366 424
367 "vineet@vinbiz.ca" = { 425 "vineet@vinbiz.ca" = {
368 hashedPasswordFile = config.age.secrets.email_vinbiz.path; 426 hashedPasswordFile = config.age.secrets.email_vinbiz.path;
369 aliases = ["postmaster@vinbiz.ca"]; 427 aliases = [ "postmaster@vinbiz.ca" ];
370 }; 428 };
371 "suresh@vinbiz.ca".hashedPasswordFile = config.age.secrets.email_vinbiz.path; 429 "suresh@vinbiz.ca".hashedPasswordFile = config.age.secrets.email_vinbiz.path;
372 "revathy@vinbiz.ca".hashedPasswordFile = config.age.secrets.email_vinbiz.path; 430 "revathy@vinbiz.ca".hashedPasswordFile = config.age.secrets.email_vinbiz.path;