Skip to content

The native CLI

This executable sets up a local development cluster with a pass-through container registry, mount-through nix store and external load balancer. It’s automatically accessible as a tool in the nativelink development flake and self contained to be usable in external projects.

To run the cluster:

Terminal window
native up

To shut the cluster down:

Terminal window
native down

Updating dependencies

From within the Nix flake:

Terminal window
go get -u ./...
go mod tidy

Then go to default.nix and adjust the vendorHash field:

  1. Change one character in the hash to invalidate it. Otherwise nix would wrongly reuse locally cached go modules the package updates.

  2. Run nix develop

  3. You should see an error message like:

    error: hash mismatch in fixed-output derivation ...
    specified: XXX
    got: YYY
  4. Substitute the old vendorHash value with YYY.

  5. Re-run nix develop. It should now build.

Making code changes

Ensure that the entire application remains self-contained. This means that no dynamic paths should point into the nativelink repository. Instead, use the //go:embed directive to embed for example templates into the executable rather than reading them disk at runtime.

The same applies to the packaging logic in default.nix. Pulumi should be bundled via a nix wrapper so that we don’t rely on a user’s local Pulumi installation.