Skip to content

Initialize nix setup for the repo#880

Merged
jupblb merged 18 commits into
mainfrom
michal/nix-init
May 26, 2026
Merged

Initialize nix setup for the repo#880
jupblb merged 18 commits into
mainfrom
michal/nix-init

Conversation

@jupblb
Copy link
Copy Markdown
Member

@jupblb jupblb commented May 25, 2026

No description provided.

jupblb added 18 commits May 18, 2026 12:10
The default devshell only had jdk11, nixfmt, and sbt, which is not enough
to drive buildTools/test, the docs site, the Docker image, or the CI
matrix. Add the external tools used by the build (bazelisk, coursier,
docker, git, gradle, jq, maven, mill, nodejs, yarn), all pinned to the
shell's JDK where applicable.

Factor the shell into mkDevShell parameterized by a JDK and expose:
- default (JDK 11, the release/build target)
- jdk17, jdk21 (CI matrix targets)
Remove dependabot.yml since the github-actions and docker ecosystems
it managed are already covered by Renovate's default managers, which
would have produced duplicate PRs.

Switch the Renovate preset from sourcegraph/renovate-config to the
upstream config:recommended preset, since the Sourcegraph preset
is tailored for Sourcegraph's own repos (internal packages, team
reviewers, etc.) and not relevant here.
- docker-setup.sh: install coursier as `cs` (with `coursier` symlink)
  so the docker image exposes the `cs` binary expected by the build.
- flake.nix: add an explicit `jdk11` devShell so workflows can use
  `.#jdk${matrix.java}` uniformly.
- Replace actions/setup-java + sbt/setup-sbt + gradle/setup-gradle +
  coursier/setup-action + yarn-installed bazelisk with
  DeterminateSystems/nix-installer-action + magic-nix-cache-action, and
  run all sbt/mvn/bazelisk/cs invocations via `nix develop`.
- BazelBuildTool: detect bazelisk/bazel on PATH at runtime and prefer
  bazelisk (so it respects the project's .bazelversion).
The .github/labeler.yml config file was removed earlier in this branch,
so the issue-labeler workflow can no longer find its configuration.
Adds three new `nix flake check` entries:
- shellcheck on bin/*.sh
- actionlint on .github/workflows/*.yml (which itself runs shellcheck
  against `run:` script bodies)
- scalafmt --check across the whole project source tree (a writable
  copy is made and `git init` ed so that `.scalafmt.conf`'s
  `project.git = true` works)

To unblock the new checks, fix the existing shellcheck findings in
bin/*.sh and ci.yml: quote variables, drop a dead `ARGS=$@` line,
and add a couple of in-line `# shellcheck disable=SC2016` directives
where we intentionally use single quotes to defer expansion to the
inner shell.
Adds a fixed-output derivation that runs `coursier bootstrap` against
a pinned scip-java version from Maven Central, plus a thin wrapper that
adds a Nix-provided JDK to PATH. Exposed as:

  nix build .#scip-java
  nix run   .#scip-java -- index ...

Bump `scipJavaVersion` and re-run `nix build` to get the new
outputHash to commit.
This config was never wired up to any workflow; releases use GitHub's
native auto-generated notes instead.
- Remove scip-java packages and apps outputs (we don't have a way to
  build from source in Nix without nontrivial sbt-derivation setup, and
  the published-artifact fetch wasn't pulling its weight)
- Drop unused 'lib' binding
- Remove redundant HOME=$(mktemp -d) from scalafmt check (nixpkgs
  scalafmt bundles its JARs and doesn't need a writable HOME)
@jupblb jupblb marked this pull request as ready for review May 26, 2026 15:41
@jupblb jupblb merged commit bed632a into main May 26, 2026
12 checks passed
@jupblb jupblb deleted the michal/nix-init branch May 26, 2026 18:34
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.

1 participant