I notice that Stack supports using a package.yaml file that it will use to generate a .cabal file. For example, yi-core/package.yaml. Its structure
package.yaml
.cabal
This is hpack, available here: https://github.com/sol/hpack
It's a slightly different package format, and, as you say, can be used to generate cabal files. It isn't directly tied to stack.