GeezerVison is showing github.com — feat(nixos): pm-stack module covers dispatch, tunnel, and the Kaneo stack by dezren39 · Pull Request #2684 · developing-today/code
Conversation
dezren39
commented
Oct 30, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
One nixos-rebuild switch on amd now deploys the whole pm stack.
Changes
- pm-dispatch joins the NixOS pm-stack module as a home-manager user service: runs
bun run src/server.ts from the /git/code checkout, EnvironmentFile = [/pm-stack/dispatch/.env, -~/secrets/dispatch.env] (both external to the module; install.sh remains their renderer and the fallback installer — its unit-install step is superseded on amd). Restart on-failure.
- pm-tunnel: module user service using pkgs.cloudflared, WorkingDirectory ~/pm-stack, EnvironmentFile ~/pm-stack/tunnel.env, ExecStart keeps the literal ${TUNNEL_TOKEN} single-word reference so systemd expands it from the EnvironmentFile (verified in the evaluated unit). Restart on-failure, RestartSec 5.
- pm-kaneo: oneshot (RemainAfterExit, TimeoutStartSec 1200) running ~/pm-stack/deploy.sh from the ~/pm-stack deployment dir (preserves the rendered .env, compose project, and pm-stack_postgres_data volume continuity), ExecStop = docker compose down (no -v). A companion timer (OnBootSec 1min, OnUnitActiveSec 30min) retries it until it succeeds once — user units cannot reliably order against the system docker.service, mirroring the projector-reconcile self-heal pattern.
- pm-git-sync: redeploys pm-dispatch.service on pm-stack/dispatch subtree changes (no dep step — runtime is pure Bun, env files are rendered by install.sh, not pulls).
- Module header + pm-stack/README.md + dispatch README updated.
Verification
- treefmt format-check on the 4 changed files: clean (0 changed on re-run).
- nix eval of the three new units + the pm-kaneo timer confirms exact ExecStart/EnvironmentFile/WorkingDirectory lines.
- Toplevel build verification in progress (mcpx go-test phase is the long pole under current laptop load).
Fixes #2671
![Autofix with [code]smith](/api/image?u=https%3A%2F%2Fcamo.githubusercontent.com%2F33b6f70f3541c4e93f4503d29cbfec051fa1b040d8e0ae9313a51c4ece44a627%2F68747470733a2f2f70722d636f6d6d656e74732d6173736574732e626c61636b736d6974682e73682f636f6465736d6974682f6175746f6669782d776974682d636f6465736d6974682d6461726b2d33782e706e67)
Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…tack
pm-dispatch and pm-tunnel join the module as home-manager user services (dispatch runs from the ~/git/code checkout with its install.sh-rendered env files external; tunnel uses pkgs.cloudflared with systemd expanding TUNNEL_TOKEN from tunnel.env). pm-kaneo is a oneshot that runs deploy.sh from the ~/pm-stack deployment dir, with a 30-min self-heal timer for docker ordering and an ExecStop that never deletes the postgres volume. pm-git-sync redeploys pm-dispatch on dispatch subtree changes.
Fixes #2671
coderabbitai
Bot
commented
Oct 30, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Warning
Review limit reached
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 54 minutes.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
2348074e-7633-4ff7-9a33-5951d5895ca0
Commits
-
Reviewing files that changed from the base of the PR and between ea1223a and 38afbad.
Files selected for processing: 4
-
nixos/services/pm-stack/default.nix
pm-stack/README.md
pm-stack/dispatch/README.md
pm-stack/scripts/pm-git-sync.sh
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
-
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Codex Review Summary
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-10-30T11:16:38.330739Z |
38afbad |
New commits |
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 64a11f56ad
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
# out deploy.sh's health gate; give it room.
|
|
|
TimeoutStartSec = 1200;
|
|
|
WorkingDirectory = "${stackDir}";
|
|
|
ExecStart = "${stackDir}/deploy.sh";
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep a single owner for the Kaneo containers
On amd, nixos/hosts/default.nix enables both services.pm-stack and services.pm-apps. The latter already declares PostgreSQL using pm-stack_postgres_data and Kaneo binding 127.0.0.1:5173 (nixos/services/pm-apps/default.nix:71–82). Starting deploy.sh here launches a second, Compose-managed stack using that same database volume and host port (pm-stack/compose.yml), so activation races the existing OCI services and cannot bring both stacks up successfully. Keep the existing OCI lifecycle as the sole owner, or explicitly migrate it before enabling this Compose service.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+156
to
+158
|
|
hand-installed unit to `*.backup`. The module does NOT render env
|
|
|
files: `~/pm-stack/dispatch/.env` and `~/secrets/dispatch.env`
|
|
|
are still produced by install.sh, below.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preserve an env-only installer path for managed dispatch units
After Home Manager takes ownership of pm-dispatch.service, the retained env-rendering workflow fails: dispatch/install.sh:120 unconditionally copies the hand-written unit onto ~/.config/systemd/user/pm-dispatch.service, now a symlink into the read-only Nix store. The installed Coreutils manual (cp invocation) specifies that, for an existing regular-file destination, “When copying to a symbolic link, ‘cp’ follows the link”. With set -e, the installer therefore exits before the restart at lines 130–131, leaving the running dispatch process on its old credentials or configuration even though .env was rewritten. Add an env-only mode or skip unit installation when Home Manager owns the service.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Build verification update (2026-10-30):
nix eval of all three new units + the pm-kaneo timer from this branch: exact ExecStart / EnvironmentFile / WorkingDirectory as designed (dispatch: /nix/store/…-bun-1.4.2/bin/bun run src/server.ts, WD ~/git/code/pm-stack/dispatch, env files [/home/user/pm-stack/dispatch/.env, -/home/user/secrets/dispatch.env]; tunnel: …-cloudflared-2026.9.3/bin/cloudflared tunnel --no-autoupdate run --token ${TUNNEL_TOKEN} with the literal token reference preserved, env ~/pm-stack/tunnel.env; kaneo: oneshot, ExecStart /home/user/pm-stack/deploy.sh, ExecStop docker compose down, TimeoutStartSec 1200).
- treefmt format-check on the 4 changed files: clean.
- Dry-run scopes as expected (21 derivations; the only fetch is cloudflared-2026.9.3).
- Full toplevel build is red for a pre-existing, unrelated reason: the mcpx package's check phase fails on current main —
TestMessagesClient/2026-07-28/messages/messages-resulttype-extension-values in internal/conformance ("declares extensions it does not handle"). Filed as mcpx: conformance TestMessagesClient fails in the Nix build — toplevel amd build is red on main #2696. Proof it's unrelated: the mcpx derivation's source is only the pkgs/mcpx/ subtree (src = ./. in pkgs/mcpx/package.nix); this PR touches no file under pkgs/mcpx/, so the failing derivation is input-identical with and without this change. Every other mcpx package in the same run passed.
- Consequence:
nixos-rebuild switch on amd is blocked by mcpx: conformance TestMessagesClient fails in the Nix build — toplevel amd build is red on main #2696 on main itself, with or without this PR. Merging so the module is in place the moment mcpx is green again.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…omplete
# Conflicts:
# pm-stack/dispatch/README.md
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|