chickadee » beaker » eggProgram

eggProgramprocedure

Builds any eggs in the given src directory, bundling all dependencies and placing the resulting binaries into <path>/bin.

The name attribute is required. Apart from that, this derivation accepts all the same attributes as eggRepository.

# build a program entirely from source
eggProgram {
  name = "example-program";
  src = ./.;
  eggCache = eggCache { ... };
}

Unlike eggRepository, this derivation only preserves shared object files in the repository path, and it does not expose the output repository to downstream derivations. This means that all egg-info, inline, link and types files are removed, and the result is unsuitable for use in the builtInputs of another eggProgram. It should only be used to produce executables, not extension repositories intended for reuse.

Combining the eggRepository and eggProgram derivations is useful to stage build operations, for example to avoid rebuilding all egg dependencies whenever the current source directory changes.

let
  # pre-compile egg dependencies
  compiledEggs = eggRepository {
    src = eggCache { ... };
  };
in
  # build program from source
  eggProgram {
    name = "example-program";
    src = ./.;
    buildInputs = [ compiledEggs ];
  }