Repository navigation
feat(dist): Nix flake module + service + cachix + FlakeHub (#1235) - #1336
Conversation
Closes #1235. Problem: The flake builds polylogue and exposes a devshell, and a NixOS module exists, but external consumers cannot `nix run github:Sinity/polylogue#polylogued` without checking the repo out, there is no Home Manager module, and built artifacts are not cached for fresh hosts. The flake is also undiscoverable outside niche Nix circles. Solution: - flake.nix: expose apps.{polylogue,polylogued,polylogue-mcp,default} so `nix run github:Sinity/polylogue#<app>` works without a checkout. Add homeManagerModules.{default,polylogue} alongside the existing nixosModules.{default,polylogue}. - nix/hm-module.nix: Home Manager module wiring a user-mode systemd.user.services.polylogued unit with the same TOML settings shape as the NixOS module (archive, daemon, daemon-api, browser-capture, embedding, logging). - .github/workflows/cachix.yml: push the polylogue package, api-python closure, and devshell closure to the polylogue cachix cache on master pushes and tags. Requires CACHIX_AUTH_TOKEN repository secret. - .github/workflows/flakehub.yml: publish the flake to FlakeHub on tag push, with a workflow_dispatch path for rolling pre-releases. Uses OIDC (id-token: write); no FlakeHub secret needed. - docs/installation.md: Nix flake section documents one-shot `nix run`, external flake input pattern, NixOS module wiring, Home Manager module wiring, and `nix build` targets. Mentions the cachix cache and FlakeHub publication. - docs/plans/distribution-coverage.yaml: nix_package notes updated to describe the new apps, modules, cachix workflow, and flakehub workflow. Verification: `devtools verify --quick` -> exit_code 0 (30.4s). `nix flake check`, NixOS VM test, and the `nix run github:Sinity/polylogue#<app>` smoke against a fresh CI runner are covered by the existing nix.yml workflow plus the new cachix workflow's first run after merge. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f562055e6a
ℹ️ 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".
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Expose polylogue as a fully external-consumable Nix flake:
nix run github:Sinity/polylogue#<app>works without a checkout, a Home Managermodule wires the user-mode daemon, the polylogue cachix cache is
populated on every master push and tag, and the flake is published to
FlakeHub on tag push.
Closes #1235. Ref #953.
Problem
The existing flake builds the
polyloguepackage and exposes adevshell, and
nix/module.nixdeclares a NixOS module. But none of theexternal-consumer paths actually worked:
nix run github:Sinity/polylogue#polyloguedfailed: the flake didnot declare any
apps.<system>.*outputs, onlypackages.nix runfell back to the default package's
meta.mainProgram, so thealternate entrypoints (
polylogued,polylogue-mcp) were notaddressable by name.
could not declaratively enable a per-user
polyloguedunit.binary cache was published.
Solution
flake.nix: addapps.x86_64-linux.{polylogue,polylogued,polylogue-mcp,default}pointing at the wrapped entrypoints under
polylogue/bin/. ExposehomeManagerModules.{default,polylogue}alongside the existing
nixosModules.{default,polylogue}.nix/hm-module.nix(new): Home Manager module that mirrorsnix/module.nixsettings shape (archive, daemon, daemon-api,browser-capture, embedding, logging) and wires
systemd.user.services.polylogued.programs.polylogued.autoStartdefaults to
true(WantedBy=default.target); setfalseto keepthe unit available but not started at login.
.github/workflows/cachix.yml(new): on master pushes andvX.Y.Ztags, build
polylogue,api-python, and the devshell closure andpush them to the
polyloguecachix cache. RequiresCACHIX_AUTH_TOKENrepository secret..github/workflows/flakehub.yml(new): publish the flake toFlakeHub on
vX.Y.Ztag push, with aworkflow_dispatchpath forrolling pre-releases. Uses OIDC (
id-token: write); no FlakeHubsecret required.
docs/installation.md: new "Nix flake" section documenting one-shotnix run, the cachix cache enable command, external flake inputpattern (both
github:and FlakeHub URLs), NixOS module wiring, HomeManager module wiring, and local
nix buildtargets.docs/plans/distribution-coverage.yaml:nix_packagenotes updatedto describe the new apps, modules, cachix workflow, and flakehub
workflow.
Non-goal: this PR does not introduce a NixOS VM test for the module —
that belongs in a follow-up under #1235's "Verification" section once
the cachix cache is producing artifacts, so the VM test does not have
to rebuild the full closure on every run.
Verification
Manual smoke (post-merge, against the published flake):
nix run github:Sinity/polylogue/master -- --version,nix run github:Sinity/polylogue/master#polylogued -- --help,nix run github:Sinity/polylogue/master#polylogue-mcp -- --help. The cachixcache hit on a fresh
nix buildwill be visible vianix path-info --jsononce the first cachix workflow run finishes after merge.🤖 Generated with Claude Code