Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support sharing Nix flakes eval cache #5195

Open
matthewbauer opened this issue Aug 30, 2021 · 3 comments
Open

Support sharing Nix flakes eval cache #5195

matthewbauer opened this issue Aug 30, 2021 · 3 comments

Comments

@matthewbauer
Copy link
Member

Apologies if there's a already a ticket for this. But, from the blog post it mentions the ability to share evaluation caches like we share store paths:

Currently, the evaluation cache is only created and used locally. However, Nix could automatically download precomputed caches, similar to how it has a binary cache for the contents of store paths. That is, if we need a cache like 302043eedf….sqlite, we could first check if it’s available on cache.nixos.org and if so fetch it from there. In this way, when we run a command such as nix shell nixpkgs#firefox, we could even avoid the need to fetch the actual source of the flake!

https://www.tweag.io/blog/2020-06-25-eval-cache/

My thinking is that each eval cache could be treated as a Nix store path. So, you'd check for something like /nix/store/am64vg72qgqpmcag2sr0b11nxm3z2hmq-302043eedfbce13ecd8169612849f6ce789c26365c9aa0e6cfd3a772d746e3ba.sqlite in the store. If it doesn't exist, we'd check the substituters.

@andir
Copy link
Member

andir commented Sep 1, 2021

Doesn't the content of the cache depend on what expressions where actually eval'ed? So we would have to take that actual attribute into account or only upload caches that eagerly went through all the attributes?

@edolstra
Copy link
Member

edolstra commented Sep 1, 2021

Doesn't the content of the cache depend on what expressions where actually eval'ed?

Yes. So the uploaded caches should be populated enough to contain the attributes necessary for operations like nix search.

@stale
Copy link

stale bot commented Apr 16, 2022

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Apr 16, 2022
@stale stale bot removed the stale label Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants