Skip to main content

Cache Population

Populating the cache involves uploading .nar files and .narinfo metadata to your OCI registry.

Automated Push via run

The simplest way to populate the cache is by using the run execution wrapper. It automatically detects new store paths generated by the inner command and pushes them.

Important: Currently, if you want Aeroflare to successfully push the resulting artifacts, you must pass the --print-out-paths flag to your Nix build command so Aeroflare knows what to upload.

nix run github:ItzEmoji/aeroflare -- run -- nix build .#default --print-out-paths

Explicit Push via CLI

If you want to manually push existing Nix store paths to the cache, you can use the aeroflare push command.

Pushing a Specific Path

nix run github:ItzEmoji/aeroflare -- push --store-path /nix/store/13x...-my-package

Pushing Multiple Paths

You can provide a file containing a list of store paths (one per line).

nix path-info --all > paths.txt
nix run github:ItzEmoji/aeroflare -- push --input paths.txt --workers 100

Note: You can increase the --workers flag to speed up the upload process. The default is 50.

Pushing Signatures

If you are maintaining a public cache, you must sign the .narinfo files so that downstream Nix clients trust them.

  1. Generate a Nix signing key pair:
    nix-store --generate-binary-cache-key my-cache-name cache-priv-key.pem cache-pub-key.pem
  2. Pass the private key to the push command:
    nix run github:ItzEmoji/aeroflare -- push --store-path /nix/store/... --signing-key ./cache-priv-key.pem

Clients consuming this cache will need to add the contents of cache-pub-key.pem to their trusted-public-keys in nix.conf.