Why does a "since last time untouched" flake still download data and take time to build?

Hi,

I’m not sure how to correctly frame it: I have a flake, and a lock file. I built it and used it and all is fine. Building made a ./result link. Then when I come back the next day and build that same flake again, I see it downloads data from cache nix or so.

With the same lock and all, should it not be super fast? What updates does it have to get from anywhere, should it not all be locally cached. I even kept the ./result link and was thinking that should prevent that derivation from being garbage collected.

Any pointers as to why, and/or how to prevent this, are appreciated :slight_smile:

Cheers, Daniel.

1 Like

What exactly is downloaded?

It might be that only inputs gets redownloaded, to be able to evaluate the drv, and only after evaluation it is seen that it is not required to actually build something.

Well I feel quite stupid right now. I waited a day on purpose before I nix build that flake again, and I only saw the evaluation, no download yet. I’ll report back when I “catch it”, but if memory serves, I would usually see it download some ~186mb from something like cache.nixos.org or so, but I think that is very non-specific :slight_smile:

Ok now after maybe some 5 days going back to an unchanged flake, and nix build shows me

[...] fetching source from https://cache.nixos.org (dl size about 30mb, copied about 180mb)

but after that download the derivation builds fast and really looks like it was cached and not rebuild. The result link seems to have stayed the same.

Is that source download maybe not related to the flake itself?