toolchain.toml
The toolchain.toml file declares which toolchains your project needs.
Basic Structure
[toolchains]
go = {}
rust = {}
python = {}
Each key under [toolchains] is a toolchain name that will be resolved from the registry.
buck2 is not declared here. Turnkey ships its own pinned buck2 release to the
shells that have the Buck2 integration, and declaring buck2 or
buck2-toolchain is an error. See
The buck2 version.
Version Pinning
You can pin specific versions when the registry provides multiple versions:
[toolchains]
go = { version = "1.22" } # Pin to Go 1.22
python = { version = "3.11" } # Pin to Python 3.11
rust = {} # Use registry default
If no version is specified, the registry's default version is used.
Available Toolchains
Languages
go- Go compiler and toolsrust- Rust compiler (rustc)cargo- Cargo package managerclippy- Rust linterrustfmt- Rust formatterrust-analyzer- Rust LSP serverpython- Python interpreteruv- Python package managerruff- Python linter and formatternodejs- Node.js runtimetypescript- TypeScript compilerbiome- Fast linter/formatter for JS/TS/JSON
Solidity
solc- Solidity compilerfoundry- Ethereum dev toolkit (forge, cast, anvil)
Other Tools
nix- Nix package managerreindeer- Rust Buck2 target generatorjsonnet- Jsonnet to JSON compilermdbook- Documentation tooltk- Turnkey CLI wrapper for buck2
Internal Tools
Dependency generators (godeps-gen, rustdeps-gen, pydeps-gen, jsdeps-gen, soldeps-gen) are automatically included when their corresponding language is enabled. You don't need to list them in toolchain.toml.
For example, if you have go = {} in your toolchain.toml and buck2.go.enable = true in your flake.nix, godeps-gen will automatically be available in your shell.
Example Configurations
Minimal Go Project
[toolchains]
go = {}
Full-Stack Project
[toolchains]
# Backend
go = {}
python = {}
# Frontend
nodejs = {}
typescript = {}
biome = {}
# Development
nix = {}
Pinned Versions
[toolchains]
go = { version = "1.22" }
python = { version = "3.11" }
nodejs = { version = "20" }
rust = { version = "1.75" }
Custom Registries
The registry mapping toolchain names to packages can be customized in your flake.nix. See Registry Pattern for details on:
- Adding custom toolchains via
registryExtensions - Creating reusable registry overlays
- Multi-version toolchain support