Repository navigation
Conversation
Adds the pi coding agent (badlogic/pi-mono) to the coder mixtape's agent
PATH alongside claude-code, codex, gemini-cli and opencode.
pi is not in nixpkgs, so lib/pi-bin.nix builds it from the published npm
tarball, following the same local-derivation pattern as lib/paper-bin.nix.
No autoPatchelfHook is needed: pi-tui ships native prebuilds for darwin
and win32 only, and the sole optionalDependency (@mariozechner/clipboard)
is darwin-only, so on Linux pi is pure JS plus one WASM blob.
Two upstream lockfile defects need patching in a source derivation (not
postPatch, which buildNpmPackage also runs in the npm-deps fetcher where
no node/jq is on PATH):
- The six pi-mono sibling packages carry a `resolved` URL but no
`integrity`, which prefetch-npm-deps and `npm ci` both reject.
- package.json declares eight devDependencies that the lockfile's root
entry omits. `npm ci` validates the pair before honouring --omit=dev,
so the mismatch escapes the sandbox's only-if-cached policy.
Because flake/images.nix derives the Lambda MicroVM bundle's agentPackages
from stereos.agent.extraPackages, pi lands in the VM images and the Lambda
MicroVM source bundle from the one mixtape edit. That closes the rough edge
tracked in pcc-labs/lambda-microvm-agents ("paperctl start pi" worked but
the coder mixtape shipped no pi binary).
Verified: builds, `pi --version` reports 0.84.3, and the coder mixtape and
coder-lambda-microvm-source both evaluate with pi in the closure.
|
| Filename | Overview |
|---|---|
| lib/pi-bin.nix | Adds a content-addressed npm derivation for pi, patches upstream lockfile defects, and limits the package to supported Linux targets. |
| mixtapes/coder/package.nix | Consolidates coding agents into one list and adds pi consistently to both restricted-agent and system-wide package surfaces. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
P[lib/pi-bin.nix] --> A[coder agents list]
A --> E[stereos.agent.extraPackages]
A --> S[environment.systemPackages]
E --> R[Restricted agent PATH]
E --> G[gVisor sandbox closure]
E --> L[Lambda MicroVM bundle]
S --> M[System-wide admin PATH]
Reviews (1): Last reviewed commit: "✨ feat: package pi in the coder mixtape" | Re-trigger Greptile
The table still listed a single `opencode-mixtape` row, a name the flake no longer builds — the mixtapes are `base` and `coder` (plus `-dev` variants). Replaces it with the real two, breaks out coder's five agents with their packages and API keys, and notes that `stereos.agent.extraPackages` also feeds the gVisor closure manifest and the Lambda MicroVM bundle, so adding a package there reaches every artifact. Binary names verified against meta.mainProgram.
Author
|
we should go with the simpler #39 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the pi coding agent to the
codermixtape's agent PATH alongsideclaude-code,codex,gemini-cliandopencode. These original ai coding agents were added in March. I've been using pi for the pokemon and sweeper pcc-labs but I need to install each time.Why
pcc-labs/lambda-microvm-agentstracks this as a known rough edge:paperctl start piworks, but the coder mixtape ships nopibinary. Sweeper has since made pi its default driver, so the gap shows up there too.Approach
pi is not in nixpkgs, so
lib/pi-bin.nixbuilds it from the published npm tarball, following the same local-derivation pattern aslib/paper-bin.nix.No
autoPatchelfHookis needed.pi-tuiships native prebuilds for darwin and win32 only, and the soleoptionalDependency(@mariozechner/clipboard) is darwin-only — so on Linux pi is pure JS plus one WASM blob. Unlikepaper-bin.nixthere are no per-arch hashes either.Because
flake/images.nixderives the Lambda MicroVM bundle'sagentPackagesfromstereos.agent.extraPackages, pi lands in the VM images and the Lambda MicroVM source bundle from the one mixtape edit.mkSandboxManifestpicks it up for the gVisor closure manifest the same way.Also: the mixtape table was stale
The README still listed a single
opencode-mixtaperow — a name the flake no longer builds. Replaced with the realbase/coderpair, coder's five agents broken out with their packages and API keys, and a note thatstereos.agent.extraPackagesfeeds the gVisor closure manifest and the Lambda MicroVM bundle as well as the agent PATH. Binary names verified againstmeta.mainProgram.Two upstream lockfile defects
Both are patched in a source derivation rather than
postPatch—buildNpmPackagerunspostPatchinside the npm-deps fetcher too, and that stdenv has nonode/jqon PATH.Missing
integrity. Upstream's custom shrinkwrap generator (scripts/generate-coding-agent-shrinkwrap.mjsin pi-mono) emits the six pi-mono sibling packages with aresolvedregistry URL but nointegrityfield. Bothprefetch-npm-depsandnpm cireject that. The tarballs are on the public registry; only the SRI hashes are missing, so they're pinned insiblingIntegrity.package.json ⟷ lockfile mismatch.
package.jsondeclares eightdevDependenciesthat the lockfile's root entry omits (devDependencies: []).npm civalidates the pair before honouring--omit=dev, so the mismatch sends it to the registry and it dies on the sandbox'sonly-if-cachedpolicy. Sincedist/is prebuilt anddontNpmBuildis set, the dev toolchain is unused — dropping it makes the pair consistent.Verified
pi --versionreports0.84.3nixosConfigurations.coderagent PATH resolves toclaude-code-2.1.158,codex-0.135.0,gemini-cli-0.43.0,opencode-1.15.13,pi-coding-agent-0.84.3packages.aarch64-linux.coder-lambda-microvm-sourceevaluates with pi in its drv closureaarch64-linuxflake/checks.nixonly builds the devshell — unaffectedReviewer notes
aarch64-darwinviaNIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1(meta.platformsis linux-only, matching paper-bin's convention). The logic is platform-independent, andnpmDepsHashshould be stable sinceprefetch-npm-depsis lockfile-driven — but a realaarch64-linuxbuild should confirm before merge.npmDepsHash, and all sixsiblingIntegrityvalues (the pi-mono packages publish in lockstep). Noted in the file header. pi moved 0.80.10 → 0.84.3 in about a month, so a refresh script may earn its keep.