Skip to content

chore(nix): read Rust channel from rust-toolchain.toml#2188

Open
worktrunk-bot wants to merge 1 commit intomainfrom
chore/nix-toolchain-single-source
Open

chore(nix): read Rust channel from rust-toolchain.toml#2188
worktrunk-bot wants to merge 1 commit intomainfrom
chore/nix-toolchain-single-source

Conversation

@worktrunk-bot
Copy link
Copy Markdown
Collaborator

Summary

Implements the first two proposals from #2185 (comment):

  • flake.nix reads the Rust channel from rust-toolchain.toml — one source of truth for rustup and Nix. The weekly MSRV bump now propagates to the Nix toolchain automatically, turning silent drift into a loud "channel not in locked rust-overlay" error if the lock also falls behind.
  • Weekly maintenance playbook now runs nix flake update — covers the residual case where a newly pinned channel is newer than the locked rust-overlay revision. The flake.nix row in the files table is gone since there is nothing to edit there anymore.

Extensions (rust-src, rust-analyzer) stay in flake.nix rather than moving into rust-toolchain.toml — putting them in the toolchain file would force rustup users and CI to download them too, and they are only useful inside the Nix dev shell.

Skipped proposal #3 (adding a nix build CI job) — that's a bigger change and worth a separate discussion.

Test plan

  • nix build .#worktrunk succeeds (could not verify in CI runner — no nix installed)
  • nix develop -c cargo build succeeds
  • nix flake check passes

Makes rust-toolchain.toml the single source of truth for the Rust version
used by both rustup (CI, local dev) and Nix, eliminating the drift that
caused #2185. Also documents the `nix flake update` step in the weekly
MSRV bump so the locked rust-overlay stays current with new toolchains.

Extensions (rust-src, rust-analyzer) stay in flake.nix since they are
only useful in the Nix dev shell — adding them to rust-toolchain.toml
would force rustup users and CI to download them too.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@max-sixty
Copy link
Copy Markdown
Owner

(if anyone knows about nix and has a view, please feel free to comment, thanks)

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.

2 participants