You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Going from the release notes, builtins.fetchTree isn't described as requiring flakes to be enabled.
builtins.fetchTree allows fetching a source tree using any backends supported by the fetcher infrastructure. It subsumes the functionality of existing built-ins like fetchGit, fetchMercurial and fetchTarball.
Steps To Reproduce
[nix-shell:~/tmp/nix]$ ./outputs/out/bin/nix --extra-experimental-features nix-command repl
Welcome to Nix 2.5. Type :? for help.
nix-repl> builtins.fetchTree {}
error: experimental Nix feature 'flakes' is disabled; use '--extra-experimental-features flakes' to override
Expected behavior
builtins.fetchTree to be available even without flakes being enabled.
Yes, it is highly desirable to have builtins.fetchTree without flakes requirement or additional toggles. For example, companies that have a forked nixpkgs repository with ssh access need shallow clone feature to avoid downloading and storing 1.8 GiB with builtins.fetchGit (though, shallow feature is currently broken).
I noticed the manual documents a fetch-tree experimental feature, and #15654 fixes an issue where URL fetches don't work without the flakes experimental feature.
I have a similar example:
$ nix --version
nix (Nix) 2.34.6
$ nix-instantiate --option experimental-features fetch-tree --eval --expr '
fetchTree {
type = "github";
owner = "NixOS";
repo = "nixpkgs";
rev = "d99b013d5d1931ad77fe3912ed218170dec5d9a4";
narHash = "sha256-7DKWmH23hL2eYdkxCKeqj2i+yljTKuU+3Nk1UPHOnxc=";
lastModified = 1779259093;
}
'
error:
… while calling the 'fetchTree' builtin
at «string»:1:1:
1| fetchTree {
| ^
2| type = "github";
error: experimental Nix feature 'flakes' is disabled; add '--extra-experimental-features flakes' to enable it
fetch-tree enables the fetchTree builtin, but I still cannot actually invoke the builtin without flakes.
I'm not sure whether #15654 addresses this specific example or not?
Activity
roberth commentedon Nov 18, 2021
Maybe it's because of the reproducibility issues that it's gated, but then it should be a different feature flag like
unstable-fetchersor something.samueldr commentedon Nov 18, 2021
@edolstra any input on that?
nixos-discourse commentedon Nov 26, 2021
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/nix-2-4-and-what-s-next/16257/1
AleXoundOS commentedon Dec 24, 2021
Yes, it is highly desirable to have
builtins.fetchTreewithout flakes requirement or additional toggles. For example, companies that have a forked nixpkgs repository with ssh access needshallowclone feature to avoid downloading and storing 1.8 GiB withbuiltins.fetchGit(though,shallowfeature is currently broken).stale commentedon Jul 10, 2022
I marked this as stale due to inactivity. → More info
nixos-discourse commentedon Dec 12, 2022
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/2022-12-09-nix-team-meeting-minutes-15/23951/1
fricklerhandwerk commentedon Dec 12, 2022
Discussed in Nix team meeting 2022-12-09:
roberth commentedon May 19, 2023
This could take advantage of
to document that it's experimental.
MattSturgeon commentedon May 22, 2026
I noticed the manual documents a
fetch-treeexperimental feature, and #15654 fixes an issue where URL fetches don't work without theflakesexperimental feature.I have a similar example:
fetch-treeenables thefetchTreebuiltin, but I still cannot actually invoke the builtin withoutflakes.I'm not sure whether #15654 addresses this specific example or not?