I’m using salt to achieve what you’re describing, it’s more complex than a single file but I keep track of how I set up various templates and VMs with salt.
There is some good stuff about salt and Qubes OS:
- Qubes Salt Beginner's Guide
- Salting your Qubes
- GitHub - ben-grande/qusal: Salt Formulas for Qubes OS.
And so on …