Open stuzenz opened 10 months ago
Devenv itself does not do downloads, the underlying Nix evaluation does. It reaches out to substitutes (or sources) when it has missing packages (derivations) that are needed to realize whatever it is evaluating. Here is a handy blog post that describes the process, plus some unrelated pitfalls.
This means once your example devenv.nix environment was once successfully initialized, all the necessary things should be on your machines' Nix store.
Can you please try turning off internet connectivity and running devenv shell
and posting the output?
If your hypothesis is true, it should fail, since you need to download the mentioned packages.
I think that's being discussed here is refetching of nixpkgs, I want to look into how we can more aggressively cache that.
We do support --offline
now, but that doesn't cover the tarballs.
One thing I noticed with
devenv shell
vsnix shell
ornix develop
is that quite often thedevenv shell
command will execute a download.For the below relatively simple environment there is about 60MB downloaded. I do enough coding while on trains etc. whilst tethered on my phone that the forced download is a bit of a problem - both due to the data use and also because of the network.
It would be great if a flag was available to tell devenv to build the environment without doing a download.
From a usability perspective, I am not even sure if the flag should be the option or the default. If by habit we don't use the flag, I am wondering about the following scenario. A user runs the default
nix develop
command and then ctrl-c out of it due to a preference not to kick off an attempt at a download. I guess as long as the old cached paths are still valid (which I guess they will be as nothing would commit to new store/cache linked paths yet) and the command again with the flag should work fine.One thing I am curious about, what are the conditions that determine whether devenv will or will not do a download?