I want to create a Flake for a go package that will build the current state of the repository.
My based on this post is that self points to the currently checked out source code. But it appears I cannot use either buildGoPackage or buildGoModule because:
buildGoModule - Because it requires vendorSha256 that would change as developer changes things.
buildGoPackage - Because it requires goDeps which has the same problem as above.
Does this effectively mean I cannot use either of those to build self in a flake.nix and I have to do it in a more “manual” way using mkDerivation?
Right, but if project has a lot of dependencies and dev work often involves updating these dependencies that adds an annoying manual step of having to update the vendorSha256 every time they bump a dependency. That’s not feasible as far as I can tell.
Thanks for answering, I’ll just go with a custom mkDerivation, possibly based off of buildGoModule. Or maybe I can modify buildGoModule itself to not check the vendorSha256 when a vendorSha256Disabled is true. That would be optimal.
Well, if I could have a script or a Makefile target that would update the vendorSha256 for the developer that would be quite sensible. But I don’t know of any command I could use to generate that vendorSha256 without trying to build given derivation.
I actually revisited this today, after abandoning this work for a while as not essential, and it appears nix-prefetch doesn’t actually support flakes:
Nothing happens. Which is a shame, because developers will almost never updated the vendor hash themslevs, so it has to be automated. Which makes flakes not adequate for team development.