2023-09-02 03:22:33 +00:00
|
|
|
{lib, ...}: let
|
|
|
|
packages = ["tmpl" "git-age" "ffmd"];
|
|
|
|
in {
|
|
|
|
services.caddy = {
|
|
|
|
enable = true;
|
|
|
|
virtualHosts = {
|
|
|
|
"jolheiser.com" = {
|
|
|
|
extraConfig = ''
|
2023-09-21 16:12:12 +00:00
|
|
|
handle_path /.well-known/webfinger {
|
|
|
|
respond "{\"subject\":\"acct:john@jolheiser.com\",\"links\":[{\"rel\":\"http://openid.net/specs/connect/1.0/issuer\",\"href\":\"https://git.jojodev.com/\"}]}"
|
|
|
|
}
|
2023-09-02 14:38:14 +00:00
|
|
|
handle_path /bennet* {
|
|
|
|
root * /srv/bennet/src
|
|
|
|
file_server
|
|
|
|
}
|
|
|
|
handle {
|
|
|
|
root * /srv/jolheiser.com/dist
|
|
|
|
file_server
|
|
|
|
}
|
2023-09-02 03:22:33 +00:00
|
|
|
'';
|
|
|
|
serverAliases = ["www.jolheiser.com"];
|
|
|
|
};
|
|
|
|
"go.jolheiser.com" = {
|
|
|
|
extraConfig =
|
|
|
|
''
|
|
|
|
header Content-Type text/html
|
|
|
|
respond / `<html><head><title>Go Packages</title></head><body><ul>${lib.strings.concatMapStrings (pkg: "<li><a href=\"${pkg}\">${pkg}</a></li>") packages}</ul></body></html>`
|
|
|
|
''
|
|
|
|
+ lib.strings.concatMapStrings (pkg: ''
|
|
|
|
respond /${pkg}* `<html><head>
|
|
|
|
<meta name="go-import" content="git.jojodev.com/jolheiser/${pkg} git https://git.jojodev.com/jolheiser/${pkg}.git">
|
|
|
|
<meta http-equiv="refresh" content="3; url=https://pkg.go.dev/go.jolheiser.com/${pkg}" />
|
|
|
|
</head><body>
|
|
|
|
Redirecting to <a href="https://pkg.go.dev/go.jolheiser.com/${pkg}">https://pkg.go.dev/go.jolheiser.com/${pkg}</a>
|
|
|
|
</body></html>`
|
|
|
|
'')
|
|
|
|
packages;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|