How to package pgenv, a program that compiles postgres?

Aaand I think I just need to get inspired by Trying to contribute to nixpkgs but only buildFHSEnv works for binary - #3 by adam248