build: Extract shapeless c+p dependency logic.

Cool, I was looking for a way to extract this logic but I couldn't figure out how to do that with sbt.