Running the Proxy Server
The Aeroflare proxy server acts as a standard HTTP binary cache. It intercepts requests from the Nix daemon and translates them into OCI manifest fetches and layer pulls.
Starting the Proxy
To start the proxy daemon manually, run:
nix run github:ItzEmoji/aeroflare -- proxy
By default, the proxy listens on http://127.0.0.1:8080.
Configuring Nix
To tell Nix to use your local Aeroflare proxy, you must pass it as a substituter.
Ad-hoc Usage
For a single command, you can pass the flag directly to Nix:
nix build .#default --option extra-substituters "http://127.0.0.1:8080"
Persistent Configuration
To configure Nix to always use the proxy, edit your nix.conf (usually located at ~/.config/nix/nix.conf or /etc/nix/nix.conf):
extra-substituters = http://127.0.0.1:8080
Note: You must ensure the Aeroflare proxy is running in the background whenever Nix attempts to build or fetch packages, otherwise substitution will fail.
Using the run Wrapper (Recommended)
Managing the proxy daemon manually can be tedious. The recommended approach for local development is to use the aeroflare run wrapper.
Important: Currently, if you want Aeroflare to successfully push the resulting artifacts, you must pass the
--print-out-pathsflag to your Nix build command so Aeroflare knows what to upload.
nix run github:ItzEmoji/aeroflare -- run -- nix build .#default --print-out-paths
This command automatically:
- Spawns an ephemeral proxy server on a random open port.
- Appends the
--option extra-substitutersflag to the inner Nix command. - Shuts down the proxy when the build finishes.
- Pushes any newly generated build artifacts to the remote backend automatically.
Running as a Container
If you'd rather not install Nix or Go just to run the proxy, it's also published as a container image — see Docker.