Skip to content

Add Nix flake for reproducible builds, dev shell and checks - #298

Open
chrstnwhlrt wants to merge 2 commits into
gluesql:mainfrom
chrstnwhlrt:main
Open

Add Nix flake for reproducible builds, dev shell and checks#298
chrstnwhlrt wants to merge 2 commits into
gluesql:mainfrom
chrstnwhlrt:main

Conversation

@chrstnwhlrt

@chrstnwhlrt chrstnwhlrt commented Apr 13, 2026

Copy link
Copy Markdown

Provides:

  • nix build builds glues, glues-tui and glues-server with the
    workspace's pinned Rust 1.93 toolchain
  • nix develop dev shell with toolchain, rust-analyzer,
    cargo-llvm-cov (for the AGENTS.md coverage workflow), cargo-deny,
    cargo-audit and the usual cargo tooling
  • nix flake check workspace build + strict clippy + nextest
  • nix fmt formats Nix files
  • overlays.default for downstream consumers

Stack: flake-parts, crane, rust-overlay, treefmt-nix.

Summary by CodeRabbit

  • Chores
    • Added Nix flake configuration enabling reproducible development environments, build setup, and automated code quality checks (linting, testing, formatting).

Provides:

- `nix build`      builds glues, glues-tui and glues-server with the
workspace's pinned Rust 1.93 toolchain
- `nix develop`    dev shell with toolchain, rust-analyzer,
cargo-llvm-cov (for the AGENTS.md coverage workflow), cargo-deny,
cargo-audit and the usual cargo tooling
- `nix flake check` workspace build + strict clippy + nextest
- `nix fmt`        formats Nix files
- `overlays.default` for downstream consumers

Stack: flake-parts, crane, rust-overlay, treefmt-nix.
@coderabbitai

coderabbitai Bot commented Apr 13, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@chrstnwhlrt has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 31 minutes and 16 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 31 minutes and 16 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8702562a-ad2b-41e1-8864-7681c0b330ec

📥 Commits

Reviewing files that changed from the base of the PR and between 9534a61 and f072c4d.

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

Walkthrough

A new Nix flake configuration is introduced for the Rust "glues" workspace, defining inputs, build process via crane with Rust toolchain pinning, development shell, package exports, and checks including clippy and nextest, plus treefmt integration for Nix code formatting.

Changes

Cohort / File(s) Summary
Nix Flake Configuration
flake.nix
New complete flake setup with nixpkgs/rust-overlay/crane inputs, per-system Rust toolchain pinning via rust-toolchain.toml, dependency and package builds, devShells.default with Rust/Nix tools, checks for clippy and nextest, and treefmt configuration for Nix formatting.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 A flake so fine with inputs grand,
Crane builds the glues across the land,
With Rust toolchain pinned just right,
Checks and shells—a developer's delight! 🌟
—Codingrabbit the builder 🏗️

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding a Nix flake configuration that enables reproducible builds, development environment, and automated checks.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@flake.nix`:
- Around line 17-19: The guidance to run `taplo fmt` from `nix develop` is
invalid because `pkgs.taplo` is not present in devShells.default.packages;
either add pkgs.taplo to the dev shell package list (update
devShells.default.packages to include pkgs.taplo) so `taplo` is available, or
remove/adjust the README/flake comments that instruct contributors to run `taplo
fmt` from the dev shell; look for the devShells.default.packages block and the
text mentioning `taplo fmt` and make them consistent.
- Around line 49-52: The dev-shell is missing rust-src and taplo: ensure
rust-src is available to match RUST_SRC_PATH by either adding "rust-src" to the
rust-toolchain.toml referenced by rustToolchain (so rustToolchain includes
rust-src) or explicitly adding rust-src to the dev shell toolchain provisioning,
and add "taplo" to the dev-shell packages list so the documented taplo fmt
command works; update references to rustToolchain, RUST_SRC_PATH, and the
dev-shell packages (where taplo should be appended) accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1860f426-d769-4eaa-ad70-a980580a171c

📥 Commits

Reviewing files that changed from the base of the PR and between 15492b9 and 9534a61.

⛔ Files ignored due to path filters (1)
  • flake.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • flake.nix

Comment thread flake.nix
Comment thread flake.nix Outdated
- Split glues-server into its own package so the default install
  ships only the client binaries
- Add taplo to the dev shell to match the taplo fmt reference
- Add rust-src to the toolchain override so RUST_SRC_PATH resolves
  for rust-analyzer
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