Skip to content

feat(flake): mkProjectServices — daemonless local dev services (process-compose + services-flake) - #807

Merged
c-vigo merged 5 commits into
devfrom
feature/795-mkprojectservices
Jul 3, 2026
Merged

c-vigo merged 5 commits into
devfrom
feature/795-mkprojectservices

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the local-services axis of ADR-nix-devenv-strategy (#794): a shared lib.mkProjectServices builder that turns declared services-flake modules into a daemonless process-compose stack, exposed as nix run .#services from a plain mkShell repo — no Docker/Podman daemon, service versions from the pinned nixpkgs lock, zero extra flake inputs downstream.

  • Helper + PoC: lib.mkProjectServices exported beside mkProjectShell; this flake carries the validating PoC (nix run .#services boots SeaweedFS S3 + Postgres), asserted end-to-end by the new tests/test_flake_services.py (boot, health probes, teardown — no container fixtures anywhere).
  • flake-parts decision (AC): resolved without adopting it — process-compose-flake's standalone evalModules (services-flake's documented no-flake-parts path); the flake stays on flake-utils. Both new inputs are dependency-free leaf lock entries (+2 total).
  • Timing note (AC): ~0.8 s eval, ~3 s closure substitute, ~3 s boot-to-healthy (x86_64-linux, warm store) vs devenv's ~165 s IFD cold-eval. Recorded in docs/NIX.md.
  • AC deviation — SeaweedFS, not MinIO: nixpkgs marks minio abandoned upstream with six unfixed CVEs (both channels); the blessed PoC uses the maintained S3-compatible SeaweedFS instead. Rationale on the issue (comment) and in docs/NIX.md.
  • Scaffold opt-in (AC): the flake stub documents a commented packages.services block; justfile.project ships a commented services recipe — both preserved-on-upgrade files, so existing consumers are untouched.
  • Verb namespace: the managed justfile.devc compose verbs are renamed devc-up/devc-down/devc-status/devc-logs/devc-shell/devc-restart/devc-open (consumer-facing, flagged under Changed). The broader justfile audit is split out to [CHORE] Audit scaffold justfile recipes for compose-era leftovers post-#799/#795 #806.
  • packages/apps move out of the Linux-only optionalAttrs guard (a shallow // would have clobbered them); only the dockerTools image set stays guarded — guarded by an eval test, and the darwin eval verified.

Verification

  • uv run pytest tests/test_flake_services.py tests/test_flake_checks.py tests/test_downstream_flake.py — 11 passed (includes the live SeaweedFS+Postgres boot)
  • bats tests/bats/init-workspace.bats tests/bats/just.bats — 87 ok
  • nix flake check --accept-flake-config + downstream-stub check with --override-input vigos — green
  • prek run --all-files — full suite green

Closes #795
Refs #794

c-vigo added 5 commits July 3, 2026 13:31
Export lib.mkProjectServices (process-compose + services-flake via the
standalone evalModules path — no flake-parts, flake stays on flake-utils).
Consumers need no extra inputs; both service flakes are dependency-free
leaf lock entries. The PoC is exposed as nix run .#services and booted
end-to-end by tests/test_flake_services.py with no container daemon.

The issue AC named MinIO, but nixpkgs marks minio abandoned upstream with
unfixed CVEs on both channels; the PoC ships the maintained S3-compatible
SeaweedFS instead (recorded on the issue and in docs/NIX.md).

packages/apps move out of the Linux-only optionalAttrs guard (shallow //
would clobber them); only the dockerTools image set stays guarded.

Refs: #795
…ename

The flake stub documents the commented mkProjectServices block (no new
inputs downstream) and justfile.project ships a commented services recipe
— both preserved-on-upgrade files, so existing consumers are untouched.
The managed justfile.devc namespaces its compose-stack verbs as devc-up/
devc-down/devc-status/devc-logs/devc-shell/devc-restart/devc-open, freeing
generic verb names (a consumer-facing rename, flagged in the changelog).

Refs: #795
…ng note

docs/NIX.md gains the Local dev services section: consumer usage, the
no-daemon / pinned-versions / GC-root properties, the recorded standalone
evalModules (no flake-parts) decision with measured eval/boot cost, and
the SeaweedFS-instead-of-abandoned-MinIO PoC rationale. Changelog entry
added under Unreleased (Added + the devc-* rename under Changed) and the
scaffold changelog mirror refreshed via just sync-workspace.

Refs: #795
@c-vigo
c-vigo enabled auto-merge July 3, 2026 11:59
@c-vigo
c-vigo merged commit d1c2919 into dev Jul 3, 2026
13 checks passed
@c-vigo
c-vigo deleted the feature/795-mkprojectservices branch July 3, 2026 12:02
c-vigo added a commit that referenced this pull request Jul 3, 2026
…eader

Adds the Changed note (devc-check/devc-upgrade completing the #795
namespacing) and the Fixed entry (worktree recipes reachable, compose
README de-stale'd, vacuous test assertion dropped). Also restores the
'Git-hook runner migrated to prek' (#778) entry header that the #795
changelog edit in PR #807 accidentally replaced, orphaning its
sub-bullets under the rename entry. Mirror synced.

Refs: #806
c-vigo added a commit that referenced this pull request Jul 3, 2026
…ble worktree recipes, de-stale'd compose docs (#809)

## Summary

Audit of the scaffold justfiles for compose-era leftovers
post-#799/#795, per #806. The audit confirmed the repo-root justfiles
are clean and the `docker-compose.project.yaml`/`local.yaml` layering is
an intentional #799 survivor; four findings were actionable and are
fixed here:

- **Namespacing completed**: `check` → `devc-check`,
`devcontainer-upgrade` → `devc-upgrade` in the managed `justfile.devc`
(recipes, hint strings, `version-check.sh` notification text, and
exact-string test assertions), freeing the generic `check` name for
project use.
- **Worktree recipes were unreachable in consumers**: the scaffold ships
`.devcontainer/justfile.worktree` *and* `.claude` skills that invoke
`just worktree-start`, but the root justfile never imported it. Now
imported via `import?` (direnv-mode safe; verified a git-less scaffold
copy still parses — `just` backtick vars are lazy).
- **Dead workflow documented**: the shipped `.devcontainer/README.md`
instructed `cp docker-compose.override.yml.example …` — a file that
hasn't shipped for a long time. Rewritten to the real project/local
layering.
- **Small cleanups**: dropped a vacuous `tests/test_image.py` assertion
on a `docker-compose.local.yml` (`.yml`) spelling nothing ships; aligned
the dev-env ADR's illustrative services verb with the shipped `just
services`; restored the #778 prek changelog entry header that #807's
changelog edit accidentally replaced (its sub-bullets were orphaned
under the #795 rename entry).

## Verification

- `bats tests/bats/init-workspace.bats tests/bats/just.bats
tests/bats/worktree-claude-cli.bats` — 99 ok (includes new red-first
#806 guards: devc-check/devc-upgrade present + bare names absent,
worktree import present, README documents live layering and not the
override workflow)
- Manual: full scaffold copy parses and `just --list` shows the
\[worktree\] group; direnv-mode load guard stays green
- `prek run --all-files` — full suite green
- The renamed-recipe integration tests (`test_integration.py`) run in
CI's container lanes

Closes #806
Refs #795, #799
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