tools for building gleam projects with nix

docs: document gleam-tool

foxgirl.engineering c10af2e7 e32bf0c0

verified
+44
+7
docs/astro.config.mjs
··· 31 31 "reference/gleam2nix", 32 32 "reference/buildgleamapplication", 33 33 "reference/buildgleam", 34 + { 35 + slug: "reference/gleam-tool", 36 + badge: { 37 + text: "internal", 38 + variant: "danger", 39 + }, 40 + }, 34 41 ], 35 42 }, 36 43 ],
+37
docs/src/content/docs/reference/gleam-tool.md
··· 1 + --- 2 + title: gleam-tool 3 + description: helper command used in gleam2nix builds 4 + --- 5 + 6 + <!-- 7 + SPDX-FileCopyrightText: 2025 Ruby Iris Juric <ruby@srxl.me> 8 + 9 + SPDX-License-Identifier: 0BSD 10 + --> 11 + 12 + :::danger 13 + this is an internal command used during nix builds, and is probably not meant to be used outside of them! 14 + ::: 15 + 16 + `gleam-tool` provides some functionality to generate some supporting files required by compiled gleam projects, that would otherwise be created through normal use of commands like `gleam build`. 17 + 18 + ## subcommands 19 + 20 + ### `appspec` 21 + 22 + ```shellsession 23 + $ gleam-tool appspec [out_path] [otp_dependencies]... 24 + ``` 25 + 26 + generates an [application specification](https://www.erlang.org/doc/apps/kernel/app) for a gleam project. 27 + 28 + - `out_path`: where to write the generated specification to 29 + - `otp_dependencies` (optional): space-separated list of otp applications name that the specification should declare a dependency on 30 + 31 + ### `entrypoint` 32 + 33 + ```shellsession 34 + $ gleam-tool entrypoint 35 + ``` 36 + 37 + generates and compiles an erlang module used as the entrypoint for running applications built by [`buildGleamApplication`](../buildgleamapplication). the final compiled module is output to `gleam_entrypoint.beam` in the current directory.