Defining builds
There are two ways to define builds, depending on your needs:- Manifest builds allow you to use the tools and commands you’re already familiar with to easily build packages with a reasonable amount of reproducibility
- Nix expression builds are for truly reproducible builds and modify existing packages, if you’re already familiar with or willing to learn some of the Nix language
Performing builds
Builds are performed with theflox build command.
When invoked with no other arguments, flox build will execute each build defined in the environment.
You can optionally specify which builds to perform:
flox successfully executes, a symlink named result-<name> will be placed in the root directory of the project.
These symlinks link to the read-only locations where the contents of each package are stored.
Continuing with the myproject example, after the build you could run the compiled binary via
Cross-platform builds
When you build a package, it is built on your host machine, and therefore only built for the system (aarch64-darwin, x86_64-linux, etc) of your host machine.
This means that if you want packages built for multiple platforms, you need to run the build on multiple platforms.
One way to accomplish this is to run your builds in CI.