I started working on some personal servers and web services on them, and found that I needed (or wanted) to author quite a bit of raw modules code to make things work.
In part this is because I wanted to be deploying behind Apache, and while there are modules for Apache, and there are Ruby webservice modules for Nginix, there’s no clear way to connect those up. The webservice modules assume an Nginx host. I wound up writing Apache modules and cribbing from the Nginx ones.
It seems like there’s a fairly common pattern here, and I wonder if there’s a common way to address it. For instance, there are several window managers and display managers, and they work together in some combinations. All the NixOS daemon scripts assume systemd. I’m sure there’s other examples that haven’t sprung immediately to mind.
What I contemplate is a kind of “rendezvous” layer. In my motivating example, I’d’ve configured a “webservice” style module, and it would get the generic “webserver” as one of its parameters. The webserver set would have functions for adding a webservice (or a static web site, which I also wanted), that the webservice could call.
Before I get too much further, is that making sense? I think it looks a little like virtual packages in other distros (Gentoo, for sure) or the “provides” attribute for some packaging systems.