I’m developing a nix package for a little project of mine, and using fetchFromGitHub
to obtain the project source. However, I’m trying to determine the sha256
to use for it, and am confused.
Until recently, I’d put in a temp/filler hash, and the error message from the builder would show me the hash I need to use. However, I did this again yesterday and find the error message now has truncated hashes in it. I’m a little perplexed!
What I see now is:
unpacking source archive /build/4a247368e0ddcea8f89e21bc80b8fcb0ae275d3c.tar.gz
error: hash mismatch in fixed-output derivation '/nix/store/lncz2pk595vqck2dcr9smd760dy6fm9m-source.drv':
specified: sha256-YZCbrFonGwaFNelzINg/dSThl4GbjB2gNQqPA1ti26o=
got: sha256-gOAFRMUuje85jTdQ4glHZPdocUg010mYQ5iCGTXjcLM=
So:
- When/why/(how!) did this message format change to be truncated, and
- How does one get access to this hash now?
Of course, this method always felt like a hack, but I’ve never been able to figure out another way. Perhaps there’s an official tool now?