Building NativeLink with Nix
These instructions contain information on how to work with NativeLink for Nix users.
You’ll need a recent version of Nix with flakes enabled, for instance installed via the next-gen nix installer.
This build doesn’t require cloning the repository, but you need to provide a
configuration file, for instance the one at https://github.com/TraceMachina/nativelink/blob/main/nativelink-config/examples/basic_cas.json
.
The following command builds and runs NativeLink in release (optimized) mode:
You can build a specific PR or branch like so:
Working with container images
View the flake outputs to list available images:
The main nativelink
container image is the image
output. Other images follow
the pattern nativelink-worker-*
.
Images use nix2container as builder and get tagged with nix derivation hashes.
To build an image locally and make it available to your container runtime:
To view the tag of an image
On NixOS
If you’re on NixOS, add the following to your system configuration: