infrastructure/notes/ideas.md

33 lines
1.1 KiB
Markdown
Raw Normal View History

2022-11-06 13:04:41 +01:00
# 1. Add port info to hosts
Re-use `hosts` setup and add domain and port information to each host
```nix
2022-12-28 15:55:38 +01:00
"overseerr" = {
2022-11-06 13:04:41 +01:00
ip = "192.168.0.105";
mac = "8E:21:7F:88:3A:83";
# new stuff
exposes = {
requests = {
domain = "requests.xirion.net";
port = 3000;
};
...
};
}
```
which then can get translated to nginx config:
```nix
virtualHosts."requests.xirion.net" = proxy "http://192.168.0.105:80";
```
Ideally hosts should also be able to access their own host information more easily so
2022-12-28 15:55:38 +01:00
that in service config one could use `thisHost.exposes.requests.port` or similar,
and the firewall can automatically be opened
2022-11-06 13:04:41 +01:00
# 2. Authoritative nameserver
Using the definitions from (1), we can then also build authoritative DNS records
by folding over `hosts[i].exposes.requests.domain` and collating that with its realm (and therefore external IP)
This also means I should probably put the external IP in some kind of meta block per realm.
[dns.nix](https://github.com/kirelagin/dns.nix) seems to be a nice DSL for DNS stuff