76 lines
2.2 KiB
Markdown
76 lines
2.2 KiB
Markdown
# dev
|
|
|
|
This is my monorepo, started in 2026.
|
|
|
|
## Monorepo structure
|
|
|
|
```text
|
|
dev/ Monorepo root
|
|
├── bazel/ Bazel support files
|
|
├── configs/ Declarative configuration
|
|
│ └── nixos/ NixOS hosts, modules, guests, registry, and secrets
|
|
├── docs/ Repository documentation
|
|
├── src/ Projects
|
|
│ └── dotfiles/ Home and system configuration
|
|
└── third_party/ External source and vendoring support
|
|
└── crates/ Generated Rust crate sources and Bazel targets
|
|
```
|
|
|
|
## Rust dependencies
|
|
|
|
The repository root contains one Cargo dependency graph.
|
|
Each Rust project declares its dependencies in its local `Cargo.toml` file.
|
|
Add each Rust project to the `members` list in the root `Cargo.toml` file.
|
|
Use explicit member paths because the Bazel generator does not expand workspace globs.
|
|
|
|
Update the shared lockfile after changing a project manifest:
|
|
|
|
```sh
|
|
cargo generate-lockfile
|
|
```
|
|
|
|
Regenerate local crate sources and Bazel targets:
|
|
|
|
```sh
|
|
bazel run //third_party:vendor_crates
|
|
```
|
|
|
|
Reference each dependency with an explicit local Bazel label:
|
|
|
|
```starlark
|
|
deps = ["//third_party/crates:crate_name"]
|
|
```
|
|
|
|
Commit the generated files under `third_party/crates/`.
|
|
Do not edit generated files manually.
|
|
|
|
## Vendored Pi
|
|
|
|
Pi source lives in `third_party/pi/`.
|
|
This directory is a squashed `git subtree` import from upstream Pi.
|
|
Local fork changes are carried directly in that vendored tree.
|
|
|
|
Update Pi with `git subtree pull`.
|
|
Use the upstream tag that matches the target CLI release:
|
|
|
|
```sh
|
|
git subtree pull \
|
|
--prefix=third_party/pi \
|
|
https://github.com/earendil-works/pi.git \
|
|
v<version> \
|
|
--squash
|
|
```
|
|
|
|
Keep the subtree import or update commit separate from local edits.
|
|
Do not squash away the `git-subtree-dir` and `git-subtree-split` trailers.
|
|
Future subtree updates use those trailers to find prior imports.
|
|
|
|
After the upstream update, resolve conflicts in `third_party/pi/`.
|
|
Keep local fork changes as ordinary commits after the vendor update.
|
|
Then verify the package:
|
|
|
|
```sh
|
|
nix build .#nixosConfigurations.zeus.config.home-manager.users.alexion.programs.pi-coding-agent.package --no-link --print-out-paths
|
|
```
|
|
|