git-hooks.nix
git-hooks.nix copied to clipboard
Proxy support
In a corporate environment, sometimes git (or anything else which requires network access, e.g. curl) will not work properly without setting environment variables all_proxy, http_proxy, https_proxy etc. Because this setup runs the pre-commit hooks in a pure environment, these environment variables are not inherited, and I get errors like:
last 10 log lines:
> failed to fetch `https://github.com/rust-lang/crates.io-index`
>
> Caused by:
> network failure seems to have happened
> if a proxy or similar is necessary `net.git-fetch-with-cli` may help here
> https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli
>
> Caused by:
> failed to resolve address for github.com: Temporary failure in name resolution; class=Net (12)
Is there any workaround to support this kind of usage?