Skip to content

Add a devenv dev shell via nix-gradle-wrapper - #2

Open
devinrsmith wants to merge 1 commit into
seqlock-review-1from
seqlock-review-2
Open

devinrsmith wants to merge 1 commit into
seqlock-review-1from
seqlock-review-2

Conversation

@devinrsmith

Copy link
Copy Markdown
Member

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.

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.
@devinrsmith
devinrsmith added this pull request to stack #3 September 22, 2026 23:50
Copilot AI balanced review requested due to automatic review settings September 22, 2026 23:50
@devinrsmith devinrsmith self-assigned this Sep 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 High severity

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 .devenv state.

Findings:

  • Critical: pkgs.jdk8 is unsupported on Intel Darwin; use a Darwin-compatible JDK 8 package.
  • Nit: Correct the warmupHook daemon-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.

Comment thread devenv.nix
# 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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants