diff --git a/src/libexpr/primops/fetchTree.cc b/src/libexpr/primops/fetchTree.cc index b49bd02e728..2b140be8df8 100644 --- a/src/libexpr/primops/fetchTree.cc +++ b/src/libexpr/primops/fetchTree.cc @@ -317,43 +317,33 @@ static RegisterPrimOp primop_fetchTree({ > } > ``` - - `"tarball"` + - `"git"` - Download a tar archive and extract it into the Nix store. - This has the same underlying implementation as [`builtins.fetchTarball`](@docroot@/language/builtins.md#builtins-fetchTarball) + Fetch a Git tree and copy it to the Nix store. + This is similar to [`builtins.fetchGit`](@docroot@/language/builtins.md#builtins-fetchGit). - - `url` (String, required) + - `allRefs` (Bool, optional) - > **Example** - > - > ```nix - > fetchTree { - > type = "tarball"; - > url = "https://github.com/NixOS/nixpkgs/tarball/nixpkgs-23.11"; - > } - > ``` + By default, this has no effect. This becomes relevant only once `shallow` cloning is disabled. - - `"git"` + Whether to fetch all references (eg. branches and tags) of the repository. + With this argument being true, it's possible to load a `rev` from *any* `ref`. + (Without setting this option, only `rev`s from the specified `ref` are supported). - Fetch a Git tree and copy it to the Nix store. - This is similar to [`builtins.fetchGit`](@docroot@/language/builtins.md#builtins-fetchGit). + Default: `false` - - `url` (String, required) + - `lastModified` (Integer, optional) - The URL formats supported are the same as for Git itself. + Unix timestamp of the fetched commit. - > **Example** - > - > ```nix - > fetchTree { - > type = "git"; - > url = "git@github.com:NixOS/nixpkgs.git"; - > } - > ``` + If set, pass through the value to the output attribute set. + Otherwise, generated from the fetched Git tree. - > **Note** - > - > If the URL points to a local directory, and no `ref` or `rev` is given, Nix only considers files added to the Git index, as listed by `git ls-files` but use the *current file contents* of the Git working directory. + - `lfs` (Bool, optional) + + Fetch any [Git LFS](https://git-lfs.com/) files. + + Default: `false` - `ref` (String, optional) @@ -369,6 +359,13 @@ static RegisterPrimOp primop_fetchTree({ Default: the tip of `ref` + - `revCount` (Integer, optional) + + Number of revisions in the history of the Git repository before the fetched commit. + + If set, pass through the value to the output attribute set. + Otherwise, generated from the fetched Git tree. + - `shallow` (Bool, optional) Make a shallow clone when fetching the Git tree. @@ -382,35 +379,38 @@ static RegisterPrimOp primop_fetchTree({ Default: `false` - - `lfs` (Bool, optional) - - Fetch any [Git LFS](https://git-lfs.com/) files. - - Default: `false` - - - `allRefs` (Bool, optional) - - By default, this has no effect. This becomes relevant only once `shallow` cloning is disabled. - - Whether to fetch all references (eg. branches and tags) of the repository. - With this argument being true, it's possible to load a `rev` from *any* `ref`. - (Without setting this option, only `rev`s from the specified `ref` are supported). + - `url` (String, required) - Default: `false` + The URL formats supported are the same as for Git itself. - - `lastModified` (Integer, optional) + > **Example** + > + > ```nix + > fetchTree { + > type = "git"; + > url = "git@github.com:NixOS/nixpkgs.git"; + > } + > ``` - Unix timestamp of the fetched commit. + > **Note** + > + > If the URL points to a local directory, and no `ref` or `rev` is given, Nix only considers files added to the Git index, as listed by `git ls-files` but use the *current file contents* of the Git working directory. - If set, pass through the value to the output attribute set. - Otherwise, generated from the fetched Git tree. + - `"tarball"` - - `revCount` (Integer, optional) + Download a tar archive and extract it into the Nix store. + This has the same underlying implementation as [`builtins.fetchTarball`](@docroot@/language/builtins.md#builtins-fetchTarball) - Number of revisions in the history of the Git repository before the fetched commit. + - `url` (String, required) - If set, pass through the value to the output attribute set. - Otherwise, generated from the fetched Git tree. + > **Example** + > + > ```nix + > fetchTree { + > type = "tarball"; + > url = "https://github.com/NixOS/nixpkgs/tarball/nixpkgs-23.11"; + > } + > ``` The following input types are still subject to change: