Skip to content

fix(nix): update flake lock so Nix build meets Rust 1.93 MSRV - #2185

Merged
max-sixty merged 1 commit into
max-sixty:mainfrom
Lysanleo:fix/nix-msrv-lock
Apr 13, 2026
Merged

max-sixty merged 1 commit into
max-sixty:mainfrom
Lysanleo:fix/nix-msrv-lock

Conversation

@Lysanleo

@Lysanleo Lysanleo commented Apr 13, 2026 •

Copy link
Copy Markdown
Contributor

Problem

After the recent minimal supported Rust version bump to Rust 1.93, the Nix dev/build path is still pulling in Rust 1.92 from the locked rust-overlay, so nix develop -c cargo build fails with: worktrunk requires rustc 1.93

Cause

Cargo.toml now requires Rust 1.93, but flake.lock still points to an older rust-overlay revision, and flake.nix uses pkgs.rust-bin.stable.latest.default.

Fix

Refresh the locked rust-overlay input so the flake provides a Rust toolchain that satisfies the current MSRV.

Validation

Run:

  • nix build .#worktrunk

@max-sixty
max-sixty merged commit 23539cf into max-sixty:main Apr 13, 2026
24 checks passed
@max-sixty

Copy link
Copy Markdown
Owner

@worktrunk-bot how can we keep these more in sync in the future?

@worktrunk-bot

Copy link
Copy Markdown
Collaborator

Three knobs, ordered by how much drift each one removes:

  1. Make rust-toolchain.toml the single source of truth for Nix too. flake.nix currently asks for pkgs.rust-bin.stable.latest.default, which floats independently of the rest of the project. Switching to pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml pins the Nix toolchain to whatever rustup is using, so the weekly bump propagates automatically. The remaining failure mode collapses from silent drift to a loud "toolchain not in locked rust-overlay" error.

  2. Refresh flake.lock during the weekly MSRV bump. Add nix flake update to .claude/skills/running-tend/SKILL.md (the "Weekly Maintenance: MSRV & Toolchain" section), and list flake.lock in its files table. Covers the residual case where (1) requests a toolchain newer than what the locked rust-overlay revision knows about.

  3. Add a Nix build to CI. A nix build .#worktrunk job would catch drift on every PR. Costs a few minutes of CI; upside is no more user-reported breakage.

I'd combine 1 + 2 — single source of truth removes most of the drift, and refreshing the lock during the same PR catches the rare new-toolchain case. Happy to open the PR if you want.

@max-sixty

Copy link
Copy Markdown
Owner

great, open a PR for those two

worktrunk-bot added a commit that referenced this pull request Apr 13, 2026
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 <[email protected]>
@worktrunk-bot

Copy link
Copy Markdown
Collaborator

Opened #2188 — covers proposals 1 and 2 (flake.nix reads the channel from rust-toolchain.toml, weekly playbook runs nix flake update). Left proposal 3 (Nix CI job) out since it feels like a separate discussion.

One note: I could not run nix build .#worktrunk to verify end-to-end — the tend CI runner doesn't have nix installed. Will need a local check before merging.

max-sixty pushed a commit that referenced this pull request Apr 18, 2026
## Summary

Implements the first two proposals from [#2185
(comment)](#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

Co-authored-by: worktrunk-bot <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
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.

3 participants