gomod2nix
gomod2nix copied to clipboard
question: how to use `mkVendorEnv` in own `buildGoModule`
Hi, I think this flake is great.
I would have liked to use mkVendorEnv in my own buildGoModule function which builds our Go package.
Can I use this function by importing this flake in my flake and then accessing mkVendorEnv before using my buildGoModule?
Would you mind giving some help on how this would look like?
Thanks a lot.
It would be cool to provide an external function mkVendorEnv which
provides the result here: https://github.com/nix-community/gomod2nix/blob/master/builder/default.nix#L250C7-L250C16
This would then be useful in composing your go.mod -> vendor dir - solution with other customized buildGoModule functions.
I reckon a function
mkVendorEnv =
{ go
, modulesFile
, goModFile
, pwd
}: