I’m suffering from cognitive overload in Nix. Do you have a quick answer to the question:
Should I be using
More involved background information would be welcome too, for future reference, but in the short term I just need simple, actionable advice on which to use.
Also, is it better to use
fetchFromGitHub) or just use
To add on, I think that the general advice is to use
pkgs.fetchgit when you can, and only fall back to
builtins.fetchGit when necessary.
Examples of times when
builtins.fetchGit is necessary:
You’re pulling in a private repository.
You don’t have a nixpkgs imported yet in the Nix expression you’re writing.
This is not true. You can use netrc but it is a bit finique.
Also if you can use the
fetchFromXxx (e.g. for github) it’s certainly better.
fetchFromGithub will populate
meta.homepage if needed, and use the
tar zip archive if possible (I guess it’s faster? Also the source says that the hash is more stable with the tar.), and fallback to
fetchgit otherwise (for advanced options).
Which you shouldn’t use and IMO we should remove because it is super annoying when reviewing because you don’t have a link to click or copy.
It is using a zip download.
I guess it’s faster?
It is faster in many cases than git cloning.
Thanks for the precision! I corrected the zip/tar error.