feat(android): Move flake to devbox.d and add android.lock#18
Draft
feat(android): Move flake to devbox.d and add android.lock#18
Conversation
This was referenced Apr 21, 2026
05d9249 to
efd31fa
Compare
Moves the Android SDK flake.nix from the ephemeral .devbox/virtenv
directory to devbox.d/<plugin-name>/ so the flake and its lock file
can be committed and version controlled per-project.
**Changes:**
- Copy flake.nix to `{{ .DevboxDir }}` instead of `{{ .Virtenv }}`
- Update core.sh to look for flake in ANDROID_CONFIG_DIR first
- Update README to clarify flake.lock location and purpose
- Add react-native example devbox.d configs to demonstrate structure
**Benefits:**
- Projects can version control their flake.lock for reproducible builds
- Each project can have different Android SDK versions/configurations
- Lock file updates via `devbox run devices.sh sync` or `nix flake update`
- Consistent with where device configs live (devbox.d/)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Implements a two-stage configuration model for reproducible Android builds: - **Stage 1**: Edit env vars in devbox.json (easy to change) - **Stage 2**: Run `android:sync` to generate lock files (commit to git) **Changes:** 1. **android.lock file** - Pins Android SDK configuration - Generated from env vars by `android:sync` command - Committed to git for team-wide reproducibility - Makes SDK changes reviewable in PRs 2. **Unified sync command** - `devbox run android:sync` - Generates android.lock from env vars - Regenerates devices.lock from device JSONs - Syncs AVDs to match device definitions - One command to sync all configuration 3. **Drift detection** - Warns on shell init if config is out of sync - Compares env vars with android.lock - Shows which values don't match - Provides clear instructions to fix 4. **Comprehensive documentation** - Explains env var → lock file model - Step-by-step update guide - Separates Android SDK updates from nixpkgs updates - Clarifies why reproducibility matters **Benefits:** - Reproducible: Lock files ensure identical builds across team - Reviewable: SDK changes visible in PRs - Explicit: Must run sync to apply changes (no accidents) - Detectable: Warns if env vars drift from lock file **Example workflow:** ```sh devbox run android:sync git add devbox.json devbox.d/ && git commit ``` Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
efd31fa to
f60ad6a
Compare
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.
Summary
Part 1 of 6 from split of #17 (~312 lines).
Implements core feature: moves flake to version-controlled location and adds android.lock for reproducibility.
Key Changes
devbox.d/for version controlandroid:synccommandRelated PRs
Part of 6-PR split of #17:
All PRs are independent and can be reviewed in parallel.