If the package you're using stays up to date and doesn't require much setup, you could plug a dockerTools.buildLayeredImage into the imageFile attribute. The name and the tag in the built image should match what's in the image attribute. An example (busybox is only included for debugging):
image = "my-calibre-web:latest";
imageFile = pkgs.dockerTools.buildLayeredImage {
name = "my-calibre-web";
tag = "latest";
contents = [ pkgs.busybox ];
config.Cmd = [
"${pkgs.calibre-web}/bin/calibre-web"
"-p"
"/config/app.db"
"-g"
"/config/gdrive.db"
"-i"
"0.0.0.0"
];
};
Here's the closest thing we have to a solution: xdg-ninja
It looks in your home for known files and folders outside of the proper xdg locations and tells you if and how you can move them to their proper place