Flake-Parts Module
Located at nix/flake-parts/turnkey/default.nix.
Purpose
Provides the user-facing API for Turnkey configuration in flakes.
Options Reference
turnkey.toolchains.enable
type = types.bool;
default = true;
Enable/disable Turnkey toolchain management.
turnkey.toolchains.declarationFiles
type = types.attrsOf types.path;
default = {};
Map shell names to toolchain.toml files:
declarationFiles = {
default = ./toolchain.toml;
ci = ./toolchain.ci.toml;
};
turnkey.toolchains.registry
type = types.lazyAttrsOf types.package;
default = {};
Custom toolchain registry. If empty, uses default registry.
turnkey.toolchains.wrapNativeTools
type = types.bool;
default = true;
Wrap go, cargo, uv with auto-sync behavior.
turnkey.toolchains.buck2
Nested options for Buck2 integration:
enable- Enable Buck2 cell generationprelude.strategy- How to provide prelude ("nix", "bundled", "git", "path")go.enable,go.depsFile- Go dependency configurationrust.enable,rust.depsFile- Rust dependency configurationpython.enable,python.depsFile- Python dependency configuration
Implementation
The module:
- Imports default registry
- Builds tw wrappers for native tools
- Creates shell configurations for each declaration file
- Passes configuration to devenv module
Extending
Add new options in the options.perSystem block and implement in config.perSystem.