buildGleam
the buildGleam function produces a derivation that compiles a gleam project, and outputs the compiled code and static assets for that project.
arguments
Section titled “arguments”required arguments:
name: the derivation’s nameversion: the derivation’s versionsrc: the location of the project source code. must be the root directory of a gleam project (ie. contains agleam.tomlandmanifest.toml)
optional arguments:
target: the compilation target language, eithererlang(default) orjavascriptbeamDeps: a list of derivations containing compiled dependencies of this projecterlang: the erlang derivation to be used as the application runtime. defaults toerlangin nixpkgsgleam: the gleam derivation used to compile your project. defaults togleamin nixpkgsgleam-tool: the gleam-tool derivation used during the build. defaults to the one included in gleam2nix
any extra arguments not listed here will be passed to the underlying stdenv.mkDerivation call.
output
Section titled “output”the built derivation contains the compiled code and support files under the following directory, based on the provided target:
- erlang:
/lib/erlang/lib/<name>-<version> - javascript:
/<name>