I wish that my application can inform me what was the GIT SHA of the commit it was build with.
I enter development shell with nix develop
and build the application successfully. However, nix build
fails. It nails down to cmake executing command git rev-parse HEAD
. The comand fails since fatal: not a git repository
.
I can locate the source in nix store with nix flake metadata
run in the git repo dir. The source in nix store is not a git repo. Not even a shallow clone. Thus git cannot work with the stored source. But flakes are intended to work with version control. Yet I cannot query that version control.
Can I fix it?