Skip to content

nix: declare the Cachix cache in the flake and document the tagged-release caveat#1564

Merged
kixelated merged 2 commits into
mainfrom
claude/vigilant-elbakyan-e417d9
May 31, 2026
Merged

nix: declare the Cachix cache in the flake and document the tagged-release caveat#1564
kixelated merged 2 commits into
mainfrom
claude/vigilant-elbakyan-e417d9

Conversation

@kixelated
Copy link
Copy Markdown
Collaborator

Summary

Makes nix run github:moq-dev/moq#moq-relay actually benefit from our Cachix cache, and documents the one caveat that previously bit consumers silently: only tagged releases are cached.

  • flake.nix: added a nixConfig block declaring kixelated.cachix.org as an extra-substituters + extra-trusted-public-keys. With it, nix run ... --accept-flake-config consults the binary cache automatically, no manual nix.conf edit or prior cachix use required. The old comment is replaced with one that spells out the tagged-releases-only behavior and the pin-to-a-tag pattern.
  • doc/setup/linux.md: the Nix bullet previously just said "use the binary cache to skip building from source." It now notes that only tagged releases are pushed, shows the pinned --accept-flake-config command, and warns that the unpinned form tracks the default branch and compiles from source.

Why

cachix.yml only fires on moq-relay-v* / moq-cli-v* / sibling tags and pins the last 10 revisions per package+OS. So a plain nix run github:moq-dev/moq#moq-relay resolves to the default-branch HEAD, which is never in the cache and falls back to building from source even when the substituter is configured. To get a cache hit you have to pin the flake ref to a recent tag:

nix run github:moq-dev/moq/moq-relay-v0.12.4#moq-relay --accept-flake-config

Reviewer notes

  • --accept-flake-config is required because Nix won't silently apply substituters from an untrusted flake. cachix use kixelated (once) is the permanent alternative; both are documented.
  • The examples hardcode v0.12.4 (current latest), which will go stale as new releases are tagged. Open to a follow-up that tracks "latest stable" instead of a pinned version if you'd prefer doc examples not need a bump each release.
  • Docs/flake only, no wire or API change, so this targets main.

(Written by Claude)

…lease caveat

Add a nixConfig block exposing kixelated.cachix.org as an extra-substituter
plus trusted public key, so `nix run ... --accept-flake-config` consults the
binary cache without a manual nix.conf edit or a prior `cachix use`.

The cache only holds tagged releases: cachix.yml fires on moq-relay-v* and
sibling tags and pins the last 10 revisions per package+OS. An unpinned
github:moq-dev/moq#moq-relay tracks the default branch HEAD, which is never
cached and compiles from source. Spell that out in the flake comment and the
Linux setup doc, and show the pin-to-a-tag pattern in both.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 31, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d700eb6a-9bad-4dce-9da6-6d2c57270150

📥 Commits

Reviewing files that changed from the base of the PR and between f727748 and cbbe891.

📒 Files selected for processing (1)
  • flake.nix

Walkthrough

This PR enables Cachix-backed binary caching for the moq project's Nix flake. The flake.nix now declares a nixConfig block that registers the kixelated.cachix.org cache as a substituter with its signing key, eliminating the need for users to manually configure Cachix. The doc/setup/linux.md is updated to document a flake-based nix run workflow using a pinned version (moq-relay-v0.12.4) with --accept-flake-config to opt into this configuration, and explains that unpinned references track the default branch (not cached) while offering cachix use kixelated as a one-time alternative for permanent cache trust.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: declaring the Cachix cache in the flake and documenting the tagged-release limitation.
Description check ✅ Passed The description is well-structured and comprehensively explains the purpose, implementation details, and rationale for the changes to both files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch claude/vigilant-elbakyan-e417d9

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 and usage tips.

@kixelated kixelated enabled auto-merge (squash) May 31, 2026 03:47
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@kixelated kixelated merged commit 3298e98 into main May 31, 2026
1 check passed
@kixelated kixelated deleted the claude/vigilant-elbakyan-e417d9 branch May 31, 2026 03:54
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