magic-nix-cache/README.md

18 lines
922 B
Markdown
Raw Normal View History

2023-06-24 22:24:52 +00:00
# The Magic Nix Cache
2023-05-08 09:48:11 +00:00
2023-06-24 22:24:52 +00:00
`magic-nix-cache` is a minimal Nix Binary Cache server backed by [the GitHub Actions Cache](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows).
2023-05-08 09:48:11 +00:00
It can be compiled into a ~3.5MB static binary for distribution, allowing it to start prefetching NARs used in a previous run even _before_ Nix is installed (not implemented yet).
## Development
This project depends on internal APIs used by the GitHub Actions Cache.
See `gha-cache/README.md` for more details on how to obtain the required tokens.
```
2023-05-08 18:59:57 +00:00
cargo run -- -c creds.json --upstream https://cache.nixos.org
2023-05-08 09:48:11 +00:00
cargo build --release --target x86_64-unknown-linux-musl
cargo build --release --target aarch64-unknown-linux-musl
nix copy --to 'http://127.0.0.1:3000' $(which bash)
nix-store --store $PWD/test-root --extra-substituters 'http://localhost:3000' --option require-sigs false -r $(which bash)
```