Conversation
Introduce five new builtins that provide native access to files from a git repository during Nix evaluation, replacing the need to shell out to git via derivations: - builtins.worldTreeSha: Get tree SHA for a world path - builtins.worldTree: Fetch a tree by SHA as a store path - builtins.worldFile: Read file contents from world repository - builtins.worldZoneSrc: Get zone source as store path - builtins.worldDir: List directory contents New CLI flags: - --world-git-dir: Path to git directory - --world-sha: Git commit SHA to use - --world-checkout-path: Optional checkout for source-available mode Features: - Lazy initialization of git resources - Tree SHA caching at each path level - Source-available mode for local development (prefers checkout files) - Zone dirty detection for uncommitted changes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Bug fixes: - Add getCommitTree() to resolve commit SHA to root tree SHA - Fix worldTreeSha/worldZoneSrc which were passing commit SHA where tree SHA was expected, causing "type does not match" errors New builtins: - worldManifest: Returns parsed //.meta/manifest.json as attrset - worldFile: Read file by full path (e.g. "//areas/tools/dev/zone.nix") - worldZoneFile: Read file by zone + relative path (old worldFile behavior) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- worldManifest now returns path -> zoneId (lifted from path -> {id: zoneId})
- Add worldManifestInverted for zoneId -> path lookups
- Extract readManifestContent helper to share manifest reading logic
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implements first-class world path syntax where //areas/tools/dev is a distinct value type (worldpath) that resolves against the world accessor. Features: - New nWorldPath value type with WorldPathData storage - Lexer patterns for //path syntax with interpolation support - ExprWorldPath AST node for evaluation - World paths work with builtins: readFile, pathExists, readDir, readFileType, import - builtins.typeOf returns "worldpath" - builtins.isWorldPath for type checking - String coercion returns the path string (e.g., "//areas/tools/dev") 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
When copyToStore is true (e.g., in derivation attributes), world paths are now properly extracted to the Nix store, just like regular paths. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
When world paths are coerced to strings (e.g., "${//path}"), they are
now tracked in the string context with a WorldZone element that includes
the original world path.
Changes:
- Add WorldZone variant to NixStringContextElem (encoded as @zone@path)
- When copying world paths to store, add WorldZone context instead of
Opaque context
- Update __getContext to expose worldZone attribute showing the source
- Update all std::visit sites to handle the new variant
Example:
__getContext "${//areas/tools/dev/zone.nix}"
=> { "/nix/store/...-zone.nix" = { path = true; worldZone = "//areas/tools/dev/zone.nix"; }; }
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
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.
No description provided.