feat: Add Nix flake for reproducible builds#94
Conversation
- Add flake.nix with naersk-based Rust build configuration - Add flake.lock for reproducible Nix dependencies This enables `nix develop` for development shell and `nix build` for building the project.
- Add `nix run github:bartolli/codanna` to Quick Start section - Lists as fourth installation option alongside curl, Homebrew, Windows
|
Hi, thanks for adding Nix flake support. Before merging, there are a few things worth addressing. The flake.lock currently pins three separate nixpkgs revisions because naersk (via fenix) and rust-overlay each bring their own. Using inputs.nixpkgs.follows = "nixpkgs" on those inputs would deduplicate them and reduce the closure size significantly. The hardcoded version = "0.9.17" in flake.nix will drift on every release -- naersk reads the version from Cargo.toml automatically, so that line can just be removed. The devShell should also set ORT_SKIP_DOWNLOAD = "1" as an env var (like the package build does), otherwise cargo build inside nix develop will try to download its own ONNX Runtime instead of using the Nix-provided one. One thing I'd like to confirm, have you run nix build to completion? The project pins ort = "=2.0.0-rc.10" (ONNX Runtime 1.22) due to glibc constraints, and the nixpkgs onnxruntime package may be a different version. If the C API doesn't match, the build will compile but fail at runtime. Also, result (the symlink nix build creates) should be added to .gitignore. These should all be quick fixes. I'm not a Nix user myself, otherwise I'd have patched them directly. Thanks again for the contribution! |
- Deduplicate nixpkgs using inputs.follows (3→1 revision) - Remove hardcoded version (naersk reads from Cargo.toml) - Add ORT_SKIP_DOWNLOAD=1 to devShell - Add result symlinks to .gitignore
yes. it was built and works. |
|
Squash-merged with onnxruntime version comments. Thanks @antono |
Adds flake.nix with naersk-based Rust build, devShell with rust-analyzer, and nix run support. Includes onnxruntime version compatibility warnings. Co-authored-by: Anton Vasiljev <antono.vasiljev@gmail.com>
- Remote embedding backend: OpenAI-compatible HTTP via CODANNA_EMBED_URL (PR #97) - Bearer auth via CODANNA_EMBED_API_KEY env var (secrets not in config files) - Dimension mismatch detection guards semantic index from silent replacement - --force with CLI paths warns about configured roots that will not be rebuilt - GetIndexInfoRequest schema includes properties:{} for OpenAI compatibility (PR #96) - Nix flake for reproducible builds and nix run support (PR #94) - Highlight range overlap panic fixed in document search
Summary
Changes
Commits
ef90ea8- Add flake.nix with naersk-based Rust build configuration5c59244- Add Nix installation option to READMEc464195- Fix nix devshell environmentDetails
flake.nix
ORT_SKIP_DOWNLOAD=1to use pre-installed ONNX RuntimeREADME.md
nix run github:bartolli/codannaas fourth installation optionWhy Nix Flakes?
Nix flakes provide:
nix runornix developgets you started instantlyThis enables users to run codanna without installing Rust or managing dependencies manually.