Skip to content

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

Draft
Lakshyyaa wants to merge 2 commits into
mainfrom
chore/nix-process-compose-dev-deps-v2
Draft

chore: replace docker-compose with nix process-compose for dev deps#64
Lakshyyaa wants to merge 2 commits into
mainfrom
chore/nix-process-compose-dev-deps-v2

Conversation

@Lakshyyaa
Copy link
Copy Markdown
Contributor

@Lakshyyaa Lakshyyaa commented Jun 4, 2026

Follows GaloyMoney/es-entity#140, GaloyMoney/job#114, and GaloyMoney/cala#729. Migrates obix's dev loop off Docker/podman onto a Nix-managed process-compose Postgres, with per-worktree port allocation so multiple checkouts run their dev DB in parallel. No Docker required for sqlx-prepare, integration tests, or make start-deps.

Changes

  • flake.nix: add process-compose-flake input; dev-env (CRC32-of-cwd → dynamic PGPORT/PG_CON), pg-start (root setpriv drop + bounded readiness), setup-db-dev, mkPg/nix-deps-base; rewrite nextest-runner off podman (XDG_CONFIG_HOME, _pgdev, bounded readiness wait, synchronous migrations); drop docker-compose/podman/podman-compose, add process-compose; export dev-env/setup-db-dev/nix-deps-base packages+apps; devShell shellHook evals dev-env
  • Makefile: start-deps/clean-deps/setup-db/reset-deps via process-compose + bounded wait; migrations folded into start-deps
  • tests/helpers.rs: read PG_CON from env (dynamic port) instead of hardcoded :5432
  • ci/pipeline.yml: drop privileged: true (no container engine needed in CI)
  • remove docker-compose.yml, nix/podman-runner.nix
  • .gitignore: add .nix-deps/

Notes

  • obix has no book/, so the runner is es-entity's minus the mdbook steps. Migrations live at repo root (job_setup, obix_setup), so setup-db-dev runs a plain sqlx migrate run (no cd, unlike cala).
  • The .sqlx cache only covers lib queries; the test-only queries (TRUNCATE persistent_outbox_events, …) are not cached, so nextest-runner compiles online against the live migrated PG. SQLX_OFFLINE=true stays in commonArgs only for the offline crane nix flake check.
  • Supersedes the stale chore: replace docker-compose with nix process-compose for dev deps #62, which used a static :5432 port and didn't touch .gitignore/ci/pipeline.yml/tests/helpers.rs (so it didn't solve multi-worktree). Mirrors how job#114 superseded its stale same-named branch.

Verification (local)

  • nix run .#dev-env → consistent per-worktree derivation (PGPORT=30800, matching PG_CON) ✅
  • alejandra -qc flake.nix
  • make start-deps → PG up via process-compose on derived port, both migrations applied ✅
  • cargo nextest run --workspace18 passed, 0 failed (online against PG_CON) ✅
  • make clean-deps → torn down, .nix-deps/ removed ✅

🤖 Generated with Claude Code


Note

Medium Risk
Touches CI test bootstrap and DB connectivity for all integration tests; behavior change is intentional but failures would block dev and CI until deps are healthy.

Overview
Replaces Docker/podman dev Postgres with Nix process-compose and a local pg-start helper, so make start-deps, migrations, and CI tests no longer need a container engine.

flake.nix adds process-compose-flake, obix-dev-env (CRC32 of checkout path → per-worktree PGPORT / PG_CON), nix-deps-base for core-pg, setup-db-dev, and rewrites nextest-runner to start PG via process-compose (root setpriv to _pgdev, bounded readiness, sync migrations). Dev shell shellHook evals dev-env. Podman/docker-compose tooling is removed.

Makefile wires start-deps / clean-deps / reset-deps through nix run and folds migrations into start-deps. tests/helpers.rs uses PG_CON from the environment instead of a fixed :5432. CI drops privileged: true. docker-compose.yml and nix/podman-runner.nix are deleted; .gitignore ignores .nix-deps/.

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

Aligns obix's dev loop with lana-bank's docker-free pattern, following
es-entity#140 / job#114 / cala#729. Dev Postgres now runs as a native
process via process-compose-flake; no Docker or podman required.

- add process-compose-flake input; dev-env (CRC32-of-cwd -> dynamic
  PGPORT/PG_CON), pg-start (root setpriv drop + bounded readiness),
  setup-db-dev, mkPg/nix-deps-base; rewrite nextest-runner off podman
- drop docker-compose/podman/podman-compose from nativeBuildInputs,
  add process-compose; export dev-env/setup-db-dev/nix-deps-base
  packages+apps; devShell shellHook evals dev-env
- Makefile: start-deps/clean-deps/setup-db/reset-deps via process-compose
  + bounded wait; migrations folded into start-deps
- tests/helpers.rs: read PG_CON from env (dynamic port) instead of
  hardcoded :5432
- ci/pipeline.yml: drop privileged: true (no container engine needed)
- remove docker-compose.yml, nix/podman-runner.nix; gitignore .nix-deps/

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Lakshyyaa Lakshyyaa marked this pull request as draft June 4, 2026 12:08
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 1 potential issue.

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 c5b1761. Configure here.

Comment thread Makefile Outdated
Mirrors the follow-up commits on GaloyMoney/cala#729:
- flake.nix: always derive DATABASE_URL from PGPORT (don't honor a stale
  inherited DATABASE_URL, which otherwise pins the old :5432 port)
- Makefile: set -e in start-deps so an orchestrator failure fails fast
- Makefile: drop dead test-in-ci target (CI calls `nix run .#nextest`)
- ci/pipeline.yml: drop unused public_docker_registry ytt import

Skipped: cala's doctest PG_CON fix (obix has no PG-connecting doctests)
and the SQLX_OFFLINE removal (obix's nextest-runner already compiles online).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Lakshyyaa Lakshyyaa marked this pull request as ready for review June 4, 2026 16:31
@Lakshyyaa Lakshyyaa closed this Jun 4, 2026
@Lakshyyaa Lakshyyaa reopened this Jun 4, 2026
@Lakshyyaa Lakshyyaa marked this pull request as draft June 5, 2026 08:36
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