I’m geting the following error before any phase executes as far as i can tell (i’ve tried echoing a message to terminal during unpack phase and got nothing)
Hash mismatches are a “rite of passage” when starting with Nix. Regarding your question, it’s worth explaining the difference between the 2 ways of writing hashes, as Nix is currently transitioning between them.
sha256 = "" (The Legacy Way)
This tells Nix specifically to expect a SHA-256 hash.
It usually expects the hash in base32 (a format specific to Nix, e.g., 0p7...) or hexadecimal.
When the build fails, Nix will provide the “got” hash in base32.
While still very common, this is considered the “old” style.
hash = "" (The Modern SRI Way)
This uses the SRI (Subresource Integrity) standard.
It is algorithm-agnostic: the prefix (sha256-, sha512-) tells Nix which algorithm to use.
When the build fails, Nix will provide a string like sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=.
Recommendation: You should prefer hash = "" for new packages. It is the modern standard used in Nixpkgs and is much cleaner.
The easiest way to get the correct hash for your VST is:
Set hash = ""; in your derivation.
Run the build (e.g., nix-build or nix build).
Nix will fail with a “hash mismatch” error.
Look for the got: line in the error message, copy the entire string starting with sha256-, and paste it into your code.
Definitely helped! I had been wondering about use of sha256 = ““ vs hash = ““ for a while.
Very interesting that somewhere along the way it converts to base32 but doesn’t care to switch back for the error message.