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 binary cache #880

Open
brckd opened this issue Feb 18, 2025 · 3 comments
Open

Add binary cache #880

brckd opened this issue Feb 18, 2025 · 3 comments

Comments

@brckd
Copy link
Contributor

brckd commented Feb 18, 2025

I noticed that especially testbeds take a long time to build. This could be avoided by caching build results. There was a Magic Cache before, but it was removed in #745 because it was deprecated. Feel free to suggest and discuss various solutions.

@brckd
Copy link
Contributor Author

brckd commented Feb 18, 2025

I recently tried out a private Cachix cache in my own configuration and can recommend it. I'm not aware of any rate limits and can also be used in local builds. They also seem to offer the most generous free tier.

The following steps would need to be added to jobs in order to be cached.

      - name: Install Nix
        uses: cachix/install-nix-action@v25
        with:
          nix_path: nixpkgs=channel:nixos-unstable
      - name: Set up Cachix
        uses: cachix/cachix-action@v14
        with:
          name: stylix
          authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
      - name: Builds to be cached
        run: nix build .\#whatever

The stylix.cachix.org cache could then be added to the flake to use it for both automated and local builds. The same entry could be added to other configurations that use Stylix.

#flake.nix
{
  nixConfig = {
    substituters = [ "stylix.cachix.org" ];
    trusted-public-keys = [ "..." ];
  };
}

@trueNAHO
Copy link
Collaborator

Related: #749

@danth
Copy link
Owner

danth commented Feb 21, 2025

There's also the option of self hosting something like Attic if the free version of Cachix too limiting. I already have a server I'm using for a few personal things which would be able to run this.

On the other hand, it's probably better to use Cachix if possible as all the infrastructure is managed for us + it's something a lot of people are already familiar with.

It might be useful to get an estimate of the size of all the testbeds and other packages before deciding which service to use - we need something which can hold at least a few commits of history before garbage collecting.

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

3 participants