Skip to content

chore: replace docker-compose with nix process-compose for dev deps#62

Open
vindard wants to merge 1 commit into
mainfrom
chore/nix-process-compose-dev-deps
Open

chore: replace docker-compose with nix process-compose for dev deps#62
vindard wants to merge 1 commit into
mainfrom
chore/nix-process-compose-dev-deps

Conversation

@vindard
Copy link
Copy Markdown

@vindard vindard commented May 28, 2026

Summary

Aligns obix's dev tooling with the lana-bank docker-free pattern shared with es-entity (#GaloyMoney/es-entity#140) and job (#GaloyMoney/job#109): contributors no longer need Docker (or podman) installed locally. `start-deps` now runs Postgres directly via `process-compose-flake`, with data stored under `.nix-deps/`.

  • Adds `process-compose-flake` flake input
  • Defines `nix-deps-base` (process-compose stack: `core-pg` + `setup-db`) and `setup-db-dev` packages
  • Updates `nextest-runner` to use the new stack instead of `podman-compose-runner`
  • Drops `docker-compose.yml` and `nix/podman-runner.nix`
  • Drops `docker-compose`, `ytt`, `podman`, `podman-compose` from `nativeBuildInputs`
  • Updates `Makefile` `start-deps` / `clean-deps` / `setup-db` to call `nix run .#...`

CI is unchanged: both `.github/workflows/test.yml` and `ci/pipeline.yml` already invoke `nix run .#nextest`, and the runner's internals are what we updated.

Refs

Test plan

  • `make start-deps` brings up Postgres + auto-applies migrations under `.nix-deps/core-pg/`
  • `cargo nextest run --workspace` — all 18 tests pass against the new PG
  • `cargo sqlx prepare --workspace --check` succeeds (pre-existing "unused queries" warning only)
  • `nix flake check` passes
  • `make clean-deps` stops the stack and clears `.nix-deps/`
  • CI green (test + check-code workflows)

🤖 Generated with Claude Code


Note

Low Risk
Changes only local dev and CI dependency orchestration; application code and production paths are untouched.

Overview
Replaces Docker/Podman-based local Postgres with a Nix + process-compose stack so dev and CI tests no longer depend on container runtimes.

flake.nix adds process-compose-flake, a local pg-start helper (initdb/data under .nix-deps/), packages nix-deps-base (core-pg then setup-db via sqlx migrate), and setup-db-dev. nextest-runner now brings that stack up with readiness waits instead of podman-compose-runner / wait4x. Dev shell drops docker/podman-related tools in favor of process-compose.

Makefile targets call nix run .#nix-deps-base and nix run .#setup-db-dev; reset-deps / test-in-ci no longer run the old shell retry loop for migrations (migrations are tied to the compose setup-db process on start-deps).

Removes docker-compose.yml and nix/podman-runner.nix.

Reviewed by Cursor Bugbot for commit b14664e. Bugbot is set up for automated code reviews on this repo. Configure here.

Aligns obix's dev tooling with the lana-bank docker-free pattern shared with
es-entity and job: contributors no longer need Docker (or podman) installed
locally. `start-deps` now runs Postgres directly via `process-compose-flake`,
with data stored under `.nix-deps/`.

- Adds `process-compose-flake` flake input
- Defines `nix-deps-base` (process-compose stack: `core-pg` + `setup-db`) and
  `setup-db-dev` packages
- Updates `nextest-runner` to use the new stack instead of
  `podman-compose-runner`
- Drops `docker-compose.yml` and `nix/podman-runner.nix`
- Drops `docker-compose`, `ytt`, `podman`, `podman-compose` from
  `nativeBuildInputs`
- Updates `Makefile` `start-deps` / `clean-deps` / `setup-db` to call
  `nix run .#...`

CI is unchanged: `.github/workflows/test.yml` and `ci/pipeline.yml` already
invoke `nix run .#nextest`, and the runner's internals are what we updated.

Refs GaloyMoney/volcano-wip#772.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b14664e. Configure here.

Comment thread flake.nix
NAME="$1" PORT="$2" PGUSER="$3" DB="$4"
PGDATA="$PWD/.nix-deps/$NAME"

mkdir -p "$PWD/.nix-deps"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

.nix-deps/ directory not added to .gitignore

Medium Severity

The PR introduces a new .nix-deps/ directory (containing PostgreSQL data files, process-compose logs, and PID files) but doesn't add it to .gitignore. A developer running git add . could accidentally commit a large PostgreSQL data directory and runtime artifacts to the repository.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b14664e. Configure here.

Comment thread flake.nix
signal = 2;
timeout_seconds = 10;
};
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Migration process lacks readiness probe risking race condition

Low Severity

The setup-db process in baseProcesses has no readiness_probe, so project is-ready --wait may consider it "ready" as soon as it enters the "Running" state—before sqlx migrate run actually completes. Both the nextest-runner and Makefile start-deps gate test execution on is-ready --wait, creating a potential race where tests begin against an unmigrated database.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b14664e. Configure here.

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