Cache Nix derivations on GitHub Actions with Attic
  • TypeScript 88.8%
  • Nix 11.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-07-31 23:14:59 +10:00
.github chore(deps): bump the github-actions group across 1 directory with 4 updates (#57) 2026-06-09 23:37:17 +01:00
dist fixup! wip 2026-07-31 23:14:59 +10:00
src fixup! action: allow specifying priority 2026-07-31 23:14:55 +10:00
.gitignore add nixpkgs? 2023-07-19 10:37:21 +08:00
.node-version feat: include or exclude paths with regex (closes #30) 2025-08-15 17:13:14 +08:00
.prettierignore feat: auto push store paths and add CI (#1) 2023-07-19 09:53:49 +08:00
.prettierrc feat: add release workflow (#2) 2023-07-19 02:51:10 +00:00
action.yml action: allow specifying priority 2026-07-31 23:01:29 +10:00
flake.lock fix: update Nix CLI syntax 2026-04-06 00:29:29 +08:00
flake.nix fix: update Nix CLI syntax 2026-04-06 00:29:29 +08:00
LICENSE feat: initial commit 2023-07-18 22:17:42 +08:00
package.json chore(deps): bump the npm-minor-patch group across 1 directory with 4 updates (#54) 2026-06-09 23:34:01 +01:00
pnpm-lock.yaml chore(deps): bump the npm-minor-patch group across 1 directory with 4 updates (#54) 2026-06-09 23:34:01 +01:00
README.md action: allow specifying priority 2026-07-31 23:01:29 +10:00
tsconfig.json feat: use nix profile to install Attic 2024-10-06 22:05:47 +08:00

attic-action

Cache Nix derivations with Attic.

Usage

Configure your Attic instance with an endpoint, a cache, and a token that can read from and write to the cache. Then, add this step to a workflow job after Nix is installed:

- name: Setup Attic cache
  uses: ryanccn/attic-action@v0
  with:
    endpoint: ${{ secrets.ATTIC_ENDPOINT }}
    cache: ${{ secrets.ATTIC_CACHE }}
    token: ${{ secrets.ATTIC_TOKEN }}

Inputs

endpoint

The Attic endpoint. This is the URL without the cache name.

cache

The name of the Attic cache.

token

The authorization token to provide to Attic (optional).

inputs-from

Path to get the Nixpkgs flake input from instead of github:NixOS/nixpkgs/nixpkgs-unstable when installing Attic (optional).

push-args

Additional command-line arguments to pass to attic push (optional).

skip-push

Disable pushing new derivations to the cache automatically at the end of the job (default is false).

This requires you to invoke attic push <cache> with the paths you want to push to the cache manually.

priority

Nix substituter priority for the Attic cache (optional). When set, the substituter URL in nix.conf will have ?priority=N appended so Nix prefers or deprioritizes this cache relative to others. For example, priority: "30" results in a substituter URL like https://attic.example.com/cache?priority=30.

Outputs

None

License

MIT