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

add workflow for pushing nix flake artifacts to Cachix #1721

Merged
merged 4 commits into from
Mar 2, 2022

Conversation

the-mikedavis
Copy link
Member

closes #1717

based on https://github.com/cachix/install-nix-action/tree/b2b9fc6cf9ad2446d49c06143ad34b98bf73be99#usage-with-flakes

I grabbed the helix cache on Cachix. I'll need to coordinate with @archseer to get the auth token secret set up in actions.

@the-mikedavis the-mikedavis marked this pull request as draft March 1, 2022 03:38
@the-mikedavis
Copy link
Member Author

the-mikedavis commented Mar 1, 2022

(WIP - will add some docs with instructions for using the cache)

I made another cache the-mikedavis-helix-bbdeca1a and pushed the tip of #1659 and this branch, and subsequent runs of nix run are pretty fast. I'll try it out on my laptop to make sure it's not just the outputs being available in my local store.

edit: it downloaded it straight from cachix and was super fast! 🎊

git checkout md-cachix
cachix use the-mikedavis-helix-bbdeca1a
nix run . -- flake.nix

@the-mikedavis the-mikedavis marked this pull request as ready for review March 1, 2022 15:27
@colemickens
Copy link

❤️ 🎊 looks great!

@archseer
Copy link
Member

archseer commented Mar 2, 2022

Added the CACHIX_AUTH_TOKEN secret.

@the-mikedavis
Copy link
Member Author

I wonder if this should be enabled on push to master plus pull_request? That might make the cache fill up quickly though 🤔

@archseer
Copy link
Member

archseer commented Mar 2, 2022

I'd only do it to pushes to master, was considering if it would make sense to limit it to once per day/some nightly tag even.

@archseer archseer merged commit 227e010 into helix-editor:master Mar 2, 2022
@the-mikedavis the-mikedavis deleted the md-cachix branch March 2, 2022 02:13
@anna328p
Copy link
Contributor

anna328p commented Mar 2, 2022

I wonder if this should be enabled on push to master plus pull_request? That might make the cache fill up quickly though thinking

Cachix does automatic garbage collection

@the-mikedavis
Copy link
Member Author

Even with the garbage collection I'm worried the 5GB would fill up too fast with pull_request on. If we have a lot of PRs open and master isn't updated in a while, the master build might be pruned to make space for builds on PRs, right?

OTOH I think it would be useful to cache pull_requests - it would make it very easy to jump between branches when reviewing or trying out new changes.

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

Successfully merging this pull request may close these issues.

Nix binary cache for flake
4 participants