Package beans-serve (web UI) from source via nix (flakes-qe0o)
The nix package added in flakes-6ne0 installs the prebuilt beans release binary (CLI + beans tui). The public release does not publish beans-serve (the web UI / GraphQL server, ~59MB because it embeds the SvelteKit frontend), so the bw = beans-serve fish abbr still relies on the imperative ~/.local/bin/beans-serve.
To package beans-serve declaratively requires building from source (github.com/hmans/beans), which is a two-stage build:
- Frontend:
frontend/is SvelteKit + pnpm.pnpm install+pnpm build, output copied intointernal/web/dist/(consumed by//go:embed dist/*ininternal/web/embed.go). Needs apnpmDepsfixed-output hash. - Backend:
go build ./cmd/beans-serve(and optionally./cmd/beans,./cmd/beans-tui) viabuildGoModulewith avendorHash. Noteinternal/graph/generated.goappears committed, butmise.toml’s build runsgo generate ./...(gqlgen) first — confirm whether codegen is needed or the committed output suffices.
Open questions
- Is the web UI (
beans-serve) actually still used, or has the workflow moved to TUI / external beans server? If unused, scrap this. - Prefer building all three from source (replacing the prebuilt-binary package in flakes-6ne0 for consistency) vs. keeping prebuilt
beans+ source-builtbeans-serve?
Tasks (if pursued)
- Frontend derivation (pnpm) -> dist
- buildGoModule with vendorHash, embedding the built frontend
- Wire into home.packages; update
bw/btabbrs as needed; drop imperative~/.local/bin/beans*