Stream: ideas

Topic: Nix binary cache


view this post on Zulip Hannes (Apr 09 2024 at 04:16):

I'm really glad for all the Nix based tooling that Roc uses, except for when I install Roc using Nix and have to compile it from source again on every update.

What do people think about having a binary cache using Cachix and using the Roc CI pipeline to push binaries to it? To use the cache, you'd just add the URL and key to your Nix config, see the Hyprland docs for an example.

The alternative would be to get Roc into nixpkgs once Roc has a numbered release, then the builds will be cached by Hydra. How close are we to the first numbered release?

view this post on Zulip Anton (Apr 09 2024 at 10:07):

to get Roc into nixpkgs once Roc has a numbered release, then the builds will be cached by Hydra. How close are we to the first numbered release?

Until we have numbered releases we could just put up a nix release with the current date in the version field. I've seen other nix packages do this too. In #5360 at the bottom I've mentioned the work that needs to be done for a nix release.

What do people think about having a binary cache using Cachix and using the Roc CI pipeline to push binaries to it?

Does cachix still have a free tier? I can't find any mention of that anymore.

view this post on Zulip Hannes (Apr 10 2024 at 03:09):

Anton said:

we could just put up a nix release with the current date in the version field. I've seen other nix packages do this too. In #5360 at the bottom I've mentioned the work that needs to be done for a nix release.

Oh, interesting, if nixpkgs doesn't mind having pre-release software then that might be a good way to go, my only concern would be how often the package could be updated. I believe it takes a while for PRs to nixpkgs to get merged, so breaking changes in the Roc language might not be reflected in nixpkgs for a while.

view this post on Zulip Hannes (Apr 10 2024 at 03:09):

Anton said:

Does cachix still have a free tier? I can't find any mention of that anymore.

Yes, it's tricky to find, but on their pricing page they say:

Users have a free 5 GB limit for open source projects.

I think this would be enough to cache ~30 nightly builds of Roc with all combinations of Linux/MacOS and ARM/x86.

view this post on Zulip Anton (Apr 10 2024 at 09:08):

so breaking changes in the Roc language might not be reflected in nixpkgs for a while.

I think that's acceptable

I think this would be enough to cache ~30 nightly builds of Roc with all combinations of Linux/MacOS and ARM/x86.

Awesome, I'll try to set it up by the end of next week

view this post on Zulip Anton (Apr 24 2024 at 18:06):

@Hannes I've set up the cachix cache, you only need to execute cachix use roc-lang once, and then nix build will use it. If you happen to be on the main branch you may not have a commit that was used to build the nightly, so it will not be cached. I'll provide a link on friday where you can easily check which commits are cached.

view this post on Zulip Anton (Apr 26 2024 at 18:11):

I'll provide a link on friday where you can easily check which commits are cached.

Today did not go as planned :sweat_smile: I'll try to do this tomorrow.

view this post on Zulip Hannes (Apr 27 2024 at 03:00):

That's okay, for now I've managed to find a commit to pin my flake input to that seems to work with the cache. Will be nice to have an easy way to check when I want to upgrade :)

view this post on Zulip Anton (Apr 27 2024 at 18:09):

Voila, https://github.com/Anton-4/roc-nix-push-cachix/blob/main/Roc-commits-in-cache.txt should now be updated daily :)

view this post on Zulip Hannes (Aug 21 2026 at 03:26):

Sorry to resurrect an old thread, I'm looking to use the Nix cache again with the new compiler, but I was thinking that the github.com/roc-lang/nightlies repo might be a better place for it now. Would a PR to add a Nix workflow to the nightlies repo be accepted and @Anton would you be willing to add the Cachix keys to the nightlies repo if I do that PR? Thanks :)

view this post on Zulip Anton (Aug 21 2026 at 11:42):

Hi @Hannes,
We have roc-overlay now so is a cache still necessary?

view this post on Zulip Hannes (Sep 01 2026 at 14:18):

Hi Anton, sorry for the delayed reply. I personally don't like consuming overlays, but that flake.nix also defines a package output that I can use, thanks!


Last updated: Sep 03 2026 at 15:16 UTC