Skip to content

Add Nix development environment #468

@speedcom

Description

@speedcom

Context

The project currently documents JDK 21 and sbt 1.11.6 as local requirements, while CI installs sbt manually. The repository also has verification tooling around the ledger module that depends on external tools such as Z3/Stainless. A lightweight Nix setup would make local development and CI-like validation more reproducible without immediately committing to a fully hermetic sbt/Nix build.

Scope

Add a minimal Nix developer environment for Amor Fati.

The first iteration should provide:

  • a flake-based dev shell
  • JDK 21
  • sbt compatible with project/build.properties
  • Python 3 for scripts/complexity.py and future local tooling
  • Z3 for ledger verification workflows
  • Git and standard shell utilities needed by the sbt build
  • SBT_OPTS aligned with CI: -Xmx4G -XX:+UseG1GC
  • optional direnv integration via .envrc
  • README or operations documentation for nix develop usage

Non-goals for the first iteration

  • Do not migrate the full sbt build into a hermetic nix build yet.
  • Do not vendor or rework sbt dependency resolution.
  • Do not make Stainless packaging a blocker unless it is straightforward from nixpkgs. It can remain controlled by STAINLESS_DIR for now.

Acceptance criteria

  • nix develop enters a shell where java -version reports a JDK 21 runtime.
  • sbt scalafmtCheckAll can be run from inside the shell.
  • sbt test can be run from inside the shell using the same baseline tools as CI.
  • The ledger verification path has documented expectations for Z3/Stainless.
  • Existing non-Nix workflows continue to work.

Notes

This should be treated as a reproducible developer/CI shell first. Full Nix packaging can be considered later if we need release builds or stronger offline reproducibility.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1:quick-winLow effort, high value — config or output onlyarea:infrastructureOutput columns, scaling, GCP, diagnosticstype:improvementTechnical enhancement, output, tooling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions