feat(nix): add client-only psql client (libpq) for read-only DB investigation #1

Merged
hermes merged 1 commits from fm/dotfiles-psql-client into main 2026-09-30 20:06:17 -04:00
Owner

Adds the client-only PostgreSQL client to the Nix Darwin config so psql is available on the normal shell PATH for read-only DB investigation.

  • Declares Homebrew libpq (keg-only client; no postgres server binary, no service) in homebrew.brews with link = true. Homebrew Bundle's link_change_state! runs brew link --force libpq for a keg-only, unlinked formula, so psql lands on /opt/homebrew/bin (already first on PATH via ~/.zprofile).
  • No server, daemon, database, default connection, service file, credential, or DATABASE_URL is configured or changed. Actual SQL access remains blocked on the separate tenant-bound read-only database grant.

Validation (no system rebuild applied):

  • nix eval .#darwinConfigurations.lt-mbp.config.homebrew.brewfile emits brew "libpq", link: true, trusted: true.
  • nix build .#darwinConfigurations.lt-mbp.system succeeds for aarch64-darwin.
  • The pinned libpq bottle ships bin/psql (plus pg_dump/pg_restore) and contains no postgres/postmaster server binary and no launchd plist.

Validated through the no-mistakes pipeline: intent, rebase, review, test, document, lint, push all completed (pr/ci skipped - this forge is Gitea). Review left one info/no-op note: brew link --force also symlinks libpq's headers/libs into the shared prefix, an acknowledged tradeoff of putting psql on PATH.

Adds the client-only PostgreSQL client to the Nix Darwin config so `psql` is available on the normal shell PATH for read-only DB investigation. - Declares Homebrew `libpq` (keg-only client; no `postgres` server binary, no service) in `homebrew.brews` with `link = true`. Homebrew Bundle's `link_change_state!` runs `brew link --force libpq` for a keg-only, unlinked formula, so `psql` lands on `/opt/homebrew/bin` (already first on PATH via `~/.zprofile`). - No server, daemon, database, default connection, service file, credential, or `DATABASE_URL` is configured or changed. Actual SQL access remains blocked on the separate tenant-bound read-only database grant. Validation (no system rebuild applied): - `nix eval .#darwinConfigurations.lt-mbp.config.homebrew.brewfile` emits `brew "libpq", link: true, trusted: true`. - `nix build .#darwinConfigurations.lt-mbp.system` succeeds for `aarch64-darwin`. - The pinned `libpq` bottle ships `bin/psql` (plus `pg_dump`/`pg_restore`) and contains no `postgres`/`postmaster` server binary and no launchd plist. Validated through the no-mistakes pipeline: intent, rebase, review, test, document, lint, push all completed (`pr`/`ci` skipped - this forge is Gitea). Review left one `info`/`no-op` note: `brew link --force` also symlinks libpq's headers/libs into the shared prefix, an acknowledged tradeoff of putting `psql` on PATH.
hermes added 1 commit 2026-09-30 19:46:24 -04:00
hermes merged commit 03e872eebc into main 2026-09-30 20:06:17 -04:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: transnet/dotfiles#1