Development Setup
Set up your environment to contribute to Turnkey.
Prerequisites
- Nix with flakes enabled
- direnv (recommended)
- Git
Clone and Enter Shell
git clone https://github.com/firefly-engineering/turnkey.git
cd turnkey
direnv allow # or: nix develop
Repository Layout
turnkey/
├── flake.nix # Main flake (self-usage example)
├── toolchain.toml # Example toolchain config
├── nix/
│ ├── flake-parts/ # Flake-parts module
│ ├── devenv/ # Devenv module
│ ├── registry/ # Default registry
│ ├── buck2/ # Buck2 integration
│ └── packages/ # Tool packages
├── cmd/ # CLI tools (Go)
├── docs/ # Documentation
└── examples/ # Example projects
Making Changes
Nix Code
- Edit files in
nix/ - Stage changes:
git add nix/ - Re-enter shell to test:
exit && nix develop
Go Code
- Edit files in
cmd/ - Build:
tk build //src/cmd/... - Run:
tk run //src/cmd/mytool:mytool
Documentation
- Edit files in
docs/ - Build book:
tk build //docs/user-manual:user-manual - Preview:
tk run //docs/user-manual:user-manual
Running Tests
# All tests
tk test //...
# Specific package
tk test //src/go/pkg/syncer:syncer_test
Pre-commit Hooks
Turnkey uses pre-commit hooks for:
- Nix flake check
- Monorepo dependency check
- Rust edition check
Hooks run automatically on commit.