gomod2nix
gomod2nix copied to clipboard
feat: add netrcFile and goModFile parameters for private modules and IFD avoidance
Adds support for authenticated private module fetches via netrc:
- New netrcFile parameter in buildGoApplication and fetchGoModule
- Reads netrc file at eval time, passes content to fetch.sh
- fetch.sh writes netrc to $HOME/.netrc for go mod download
Adds goModFile parameter to avoid IFD when pwd is a derivation:
- When pwd points to a derivation output, reading go.mod forces IFD
- goModFile allows passing a raw path that's copied at eval time
- Removes pathExists check which also caused IFD issues
Users can pass GOPROXY as an impure env var to use a custom proxy.