1# see /docs/utils.md for a usage guide
2{
3 # inputs,
4 # system,
5 ...
6}: rec {
7 mkVhost = {...} @ opts:
8 {
9 # ideally mkOverride/mkDefault would be used, but i have 0 idea how it works.
10 forceSSL = true;
11 useACMEHost = "global.c.soopy.moe";
12 kTLS = true;
13 }
14 // opts;
15
16 mkSimpleProxy = {
17 port,
18 protocol ? "http",
19 location ? "/",
20 websockets ? false,
21 }:
22 mkVhost {
23 locations."${location}" = {
24 proxyPass = "${protocol}://localhost:${toString port}";
25 proxyWebsockets = websockets;
26 };
27 };
28}