I wrote a config adapter for Caddy so you can write your Caddy configs with Pkl: https://github.com/caddyserver/pkl-adapter
The big gotcha is it's only implemented in Java. So any language bindings have to shell out to a subprocess to actually do any work.