Skip to content

FlakeHub Cache

Actions
Free, no-configuration Nix cache. Cut CI time by 50% or more by caching to GitHub Actions cache
v1
Latest
Verified creator
Star (1)

Verified

GitHub has manually verified the creator of the action as an official partner organization. For more info see About badges in GitHub Marketplace.

FlakeHub Cache Action

Use FlakeHub Cache, zero-configuration binary cache for Nix on GitHub Actions.

Add our GitHub Action after installing Nix, in your workflow, like this:

- uses: DeterminateSystems/flakehub-cache-action@main

See Usage for a detailed example.

Why use FlakeHub Cache?

  • Automatic, authenticated integration with GitHub Actions
  • Cached paths are available on developer and target machines
  • Fully managed by Determinate Systems

Usage

Add it to your Linux and macOS GitHub Actions workflows, like this:

name: CI

on:
  push:
  pull_request:

jobs:
  check:
    runs-on: ubuntu-22.04
    permissions:
      id-token: "write"
      contents: "read"
    steps:
      - uses: actions/checkout@v4
      - uses: DeterminateSystems/nix-installer-action@main
      - uses: DeterminateSystems/flakehub-cache-action@main
      - uses: DeterminateSystems/flake-checker-action@main
      - name: Run `nix build`
        run: nix build .

That's it. Everything built in your workflow will be cached.

Action Options

Parameter Description Required Default
diff-store Whether or not to diff the store before and after magic-nix-cache runs
flakehub-api-server The FlakeHub API server. https://api.flakehub.com
flakehub-cache-server The FlakeHub binary cache server. https://cache.flakehub.com
flakehub-flake-name The name of your flake on FlakeHub. The empty string will autodetect your FlakeHub flake.
listen The host and port to listen on. 127.0.0.1:37515
source-binary Run a version of the cache binary from somewhere already on disk. Conflicts with all other source-* options.
source-branch The branch of magic-nix-cache to use. Conflicts with all other source-* options.
source-pr The PR of magic-nix-cache to use. Conflicts with all other source-* options.
source-revision The revision of nix-magic-nix-cache to use. Conflicts with all other source-* options.
source-tag The tag of magic-nix-cache to use. Conflicts with all other source-* options.
source-url A URL pointing to a magic-nix-cache binary. Overrides all other source-* options.
startup-notification-port The port magic-nix-cache uses for daemon startup notification. 41239

FlakeHub Cache is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Free, no-configuration Nix cache. Cut CI time by 50% or more by caching to GitHub Actions cache
v1
Latest

Verified

GitHub has manually verified the creator of the action as an official partner organization. For more info see About badges in GitHub Marketplace.

FlakeHub Cache is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.