You can combine all three. See How the approaches combine.
Start with a setup script
Use a project setup script as the starting point for custom dependencies. Tembo runs the script after cloning your repositories while it builds the project’s prepared environments. Anything the script installs or writes to disk becomes part of those environments. Add your script under Advanced setup when you create or edit a project. See Setup script for details.Declare packages with tembo.nix
tembo.nix is currently in beta and will be available to everyone very soon. If you have beta access, use the sections below to declare system packages and toolchains in your repository.Prerequisites
- You have a repository connected to Tembo.
- You know which system packages or language toolchains your project needs.
Create tembo.nix
Createtembo.nix in your repository root with a default dev shell. Tembo uses devShells.x86_64-linux.default in the sandbox.
go test, cargo test, or Java build tools.
Add packages
Add packages to thepackages list. For example, this dev shell adds PostgreSQL client tools and pkg-config for projects that compile native dependencies:
Configure the shell
UseshellHook when the sandbox needs environment variables for local commands:
tembo.nix. Add secrets through your sandbox environment variables instead.
Bring your own deps
Bring your own deps (BYOD) removes the need to write Nix yourself. Instead of authoring atembo.nix per repository, you point Tembo at the repositories you care about and an agent reads the dependency configuration those repositories already contain, then translates it into a single Nix environment for your whole workspace.
Bring your own deps is in early access and is not yet enabled for every workspace. It requires the Max or Enterprise plan. If you would like access, book a call with us.
What Tembo reads
The agent starts from the configuration in your repositories rather than guessing, including:- Container config:
Dockerfile(and variants such asDockerfile.prod),docker-compose.yml,compose.yml, anddevcontainer.json - Version pins:
.tool-versions,.nvmrc,.node-version,.python-version,.ruby-version, and.sdkmanrc - Language manifests and lockfiles:
package.json,go.mod,pyproject.toml,requirements.txt,Pipfile,Gemfile,Cargo.toml,pom.xml,build.gradle,composer.json,mix.exs,pubspec.yaml, and their lockfiles - Existing Nix files:
flake.nix,shell.nix,default.nix, andtembo.nix
Prerequisites
- Your workspace has bring your own deps enabled.
- You have workspace admin access.
- The repositories you want to include are already connected to Tembo.
Generate an environment
- Open Settings > Projects.
- Click New project.
- Choose a name and select the repositories to include.
- Turn on Install dependencies.
- Expand Advanced setup and find the BYOD environment section.
- Click Generate environment.
<name> to do the work. Click View generation session to watch it: the agent writes a flake, verifies it by entering the dev shell, and then verifies each repository’s own build, test, and typecheck commands, retrying and fixing failures as it goes.
The BYOD environment section shows a status badge:
The badge does not update on its own while generation runs. Reload the page to see the current status.
The environment is shared across your whole workspace, not scoped to the project you created it from. Generating again from any project replaces the workspace’s environment.
Build the environment into your projects
Generating a flake does not by itself change your sessions. Tembo bakes the environment into a project’s prepared environment when that project is built, so build or rebuild the project environment after generation completes. Sessions started from that project then have the toolchain already present, with no dependency install at session start. Because Tembo captures the complete dev shell rather than justPATH, variables such as LD_LIBRARY_PATH, PKG_CONFIG_PATH, and anything you export from a shellHook are available to agent commands and to the sandbox terminal.
Review and edit the flake
Tembo stores the generated flake for your workspace; it is not written to your repository unless the agent opens a pull request addingflake.nix and flake.lock, which is optional.
To inspect or change it, click Edit flake in the BYOD environment section, make your changes, and click Save flake.
To pick up new dependencies after your repositories change, click Regenerate. Each regeneration runs in a new session.
How the approaches combine
The three approaches layer rather than compete:- Bring your own deps and
tembo.nixare merged. When a bring your own deps environment exists, Tembo still reads each selected repository’stembo.nixand merges its dev shell into the generated one. If both provide the same tool, the repository’stembo.nixwins. A repository that needs an exact toolchain can keep pinning it locally while the generated environment covers everything else. - Setup scripts always run on top. The dev shell covers system packages and toolchains, not project installs. Your project setup script still runs afterwards, inside the environment, so commands like
pnpm installorbundle installbehave as expected. - Without bring your own deps,
tembo.nixapplies per repository. Each repository’s dev shell is prepared on its own, and sessions use the primary repository’s shell.
Tips
- Keep
tembo.nixfocused on system packages and toolchains that your project needs. - Commit the file so Tembo can load it in every new session.
- Keep secrets out of both
tembo.nixand the generated flake. Use environment variables instead. - Use projects if installing dependencies still takes meaningful time at the start of each session.