Loading
nix-prefetch-git: add `--name` parameter
This allows tools like `npins` to avoid re-downloading pre-fetched sources at evaluation time, by setting the same symbolic store path name as `builtins.fetchGit` does, and would make hacks such as [0] obsolete. Historical note: `builtins.fetchGit` was introduced in 2016 [1] and released in 2018 [2]. Before that, there was only the Nixpkgs `fetchgit`, and the convention for using constant store path names [3] was not established yet [4]. While arguably in retrospect store path names were a mistake, we cannot undo it here even partially by setting them to a constant, as it would invalidate countless fixed-output derivations and thus incur an increase in resource consumption and potentially a large number of build failures. [0]: https://github.com/andir/npins/commit/f0449d090cd4cbf17849d29821a53ead9a88c42a [1]: https://github.com/nixos/nix/commit/38539b943a060d9cdfc24d6e5d997c0885b8aa2f [2]: https://github.com/NixOS/nix/releases/tag/2.0 [3]: https://github.com/NixOS/nix.dev/blob/db00265e810b3729a1077a0e5f8f4112f49019af/source/guides/best-practices.md#L263-L264 [4]: https://github.com/NixOS/nixpkgs/commit/a8603605aaaf780aa45edd0f16c8c9588455ccf2