Skip to main content

Documentation Index

Fetch the complete documentation index at: https://flox.dev/docs/llms.txt

Use this file to discover all available pages before exploring further.

Build with Flox

Not only can you develop your software with Flox, but you can build it as well. See the builds concept page for more details.

Manifest builds

Autotools

Since autotools isn’t specific to C, this example will also work for any project using autotools. Since the output of the build must be copied to the $out directory, you must set the install prefix to $out.
[build.myproject]
command = '''
  ./configure --prefix=$out
  make
  make install
'''

CMake

Doing a CMake build looks much the same as autotools.
[build.myproject]
command = '''
  cmake -DCMAKE_INSTALL_PREFIX=$out
  make
  make install PREFIX=$out
'''

Nix expression builds

To build a project using clang:
{ clangStdenv }:

clangStdenv.mkDerivation {
  pname = "myproject";
  version = "0.0.1";
  src = ../../.;

  installFlags = [ "PREFIX=$(out)" ];
}