Repository navigation
Add a devenv dev shell via nix-gradle-wrapper - #2
Open
devinrsmith wants to merge 1 commit into
Open
devinrsmith wants to merge 1 commit into
devinrsmith wants to merge 1 commit into
Conversation
devenv.nix/devenv.yaml/devenv.lock provide the reproducible environment the build needs (run Gradle as `devenv shell -- ./gradlew ...`): - nix-gradle-wrapper (github.com/devinrsmith/nix-gradle-wrapper, a non-flake input) vendors the exact Gradle distribution pinned in gradle/wrapper/gradle-wrapper.properties. Its isolatedHomeHook gives the shell an isolated GRADLE_USER_HOME with toolchain auto-detect and auto-download disabled (and manages GRADLE_ENCRYPTION_KEY itself, so the Configuration Cache keystore works against its symlinked caches); warmupHook pre-starts the daemon. - extraJdkHomes registers every toolchain the build uses: JDK 8 (base source set), 11 (java11 override), and 17/21/25 (the extra test runtimes). javaHome pins the Gradle daemon itself to JDK 25. jdkHome resolves the Darwin bundle layout as well as Linux. - perWorkerMemBytes is lowered to 512 MiB so the wrapper's worker count doesn't collapse to 1 on small machines for this tiny project. .gitignore ignores .devenv, the state directory devenv creates in the project root.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The JDK 8 configuration prevents the development shell from building on Intel Macs.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Adds a reproducible devenv shell for Gradle builds with pinned dependencies and JDK toolchains.
Changes:
- Pins devenv, nixpkgs, and nix-gradle-wrapper inputs.
- Configures isolated Gradle state and JDKs 8, 11, 17, 21, and 25.
- Ignores generated
.devenvstate.
Findings:
- Critical:
pkgs.jdk8is unsupported on Intel Darwin; use a Darwin-compatible JDK 8 package. - Nit: Correct the
warmupHookdaemon-start claim or explicitly start the daemon.
| File | Description |
|---|---|
devenv.yaml |
Declares devenv inputs. |
devenv.nix |
Configures Gradle and Java toolchains. |
devenv.lock |
Pins environment dependencies. |
.gitignore |
Excludes devenv state. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # gradle-wrapper.nix's isolatedHomeHook disables Gradle's own toolchain | ||
| # auto-detect/auto-download, so all of these have to be registered | ||
| # explicitly via extraJdkHomes below rather than relying on scanning. | ||
| jdk8 = pkgs.jdk8; |
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.

devenv.nix/devenv.yaml/devenv.lock provide the reproducible environment the build needs (run Gradle as
devenv shell -- ./gradlew ...):.gitignore ignores .devenv, the state directory devenv creates in the project root.