Open Source Docs

Sbtix

Reproducible Nix builds for sbt projects

Caveats

Known limitations and offline-build considerations


Why not? (caveats)

  • Sbtix 1.0.x is intended as the stable baseline for the current CLI, generated Nix, and builder APIs. Please report any regressions or missing offline artifacts.

  • Some sbt-internal tooling artifacts are not declared as normal project/library dependencies. sbtix locks the Scala 2.13 / Scala 3 compiler bridge (org.scala-lang:scala2-sbt-bridge / org.scala-lang:scala3-sbt-bridge) automatically, but you may still need to add rare missing artifacts to manual-repo.nix.

  • When sbtix enriches POM metadata for offline builds, it only fetches missing parent/BOM metadata from Maven Central. Private and Ivy repository metadata is locked when Coursier has already resolved or cached it; otherwise, add the missing metadata to manual-repo.nix so generation does not perform surprising authenticated network fetches.

  • sbtix detects sbt-scalafmt in project/plugins.sbt and locks the configured .scalafmt.conf formatter runtime automatically, so scalafmtOnCompile can run in sandboxed Nix builds. For other plugins that download tooling at runtime, either disable non-build tasks when SBTIX_NIX_BUILD=1 / -Dsbtix.nixBuild=true is set, or add the missing artifacts to manual-repo.nix.

  • Offline sbt bootstrap is pinned: the generated sbtix-plugin-repo.nix (seeded from sbtix’s bundled template under plugin/sbtix-plugin-repo.nix) only includes sbt launcher/bootstrap artifacts for the sbt version shipped with sbtix (currently sbt 1.12.11, e.g. org.scala-sbt:main_2.12:1.12.11). If your project uses a different sbt.version in project/build.properties, a sandboxed/offline nix build can fail unless those sbt boot artifacts are also available offline (typically by aligning sbt.version, or by manually pinning the missing sbt artifacts in manual-repo.nix).