Skip to content

DeterminateSystems/flakehub-cache-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 6