How to access git repo metadata in a derivation

currently I am trying to build a personal site using nix, specifically with hakyll, during the build process my site builder attempts to access git metadata about my files to generate things like dates modified and author info, however, when it comes time to build the derivation it fails because git cannot get the metadata. anyone have techniques for being able to pass all files of the source repo including the .git directory?