Nix flake packaging: nix run github:rtk-ai/icm#320
Open
Donach wants to merge 1 commit into
Open
Conversation
Adds a flake.nix so Nix/NixOS users can build, run, and install icm directly from the repo: nix run github:rtk-ai/icm nix profile install github:rtk-ai/icm Design notes: - cargoLock.lockFile vendors deps straight from the committed Cargo.lock, so there is no cargoHash to bump on dependency updates — the flake is zero-maintenance for day-to-day development. - OPENSSL_NO_VENDOR + ORT_STRATEGY=system link the nixpkgs openssl and onnxruntime (fastembed/ort cannot download prebuilts in the Nix sandbox). - Default features (rusqlite backend, embeddings, tui) — the binary is identical in behaviour to a stock cargo build. - devShells.default provides the Rust toolchain + native deps for hacking. - Linux systems only for now (x86_64/aarch64); darwin likely works but is unverified, trivially addable. No impact on cargo users; .gitignore gains the nix 'result' symlink.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
flake.nixso Nix/NixOS users can build, run, and install icm straight from the repo:No impact on cargo users — the binary is a stock default-features build (rusqlite backend, embeddings, tui), just packaged.
Design
cargoLock.lockFilevendors dependencies straight from the committedCargo.lock, so there's nocargoHashto bump on dependency updates. Release-please version bumps only touch the oneversionfield.OPENSSL_NO_VENDOR=1links the nixpkgs openssl, andORT_STRATEGY=systempoints fastembed/ort at the nixpkgsonnxruntime(prebuilt downloads don't work inside the Nix build sandbox).nix developgives the Rust toolchain + pkg-config/openssl/onnxruntime for hacking on the repo without global installs.x86_64-linux,aarch64-linux) since that's what I can verify; darwin most likely works (onnxruntime/openssl exist there) and is a one-line addition if someone can confirm.Verified:
nix build✅,nix flake check✅,nix run . -- --version→icm 0.10.57✅.CI could later gain a
nix buildjob, but I've kept this PR minimal on purpose.Stacking note
This is the base of a small stack: #262 (opt-in libSQL/Turso backend) will be rebased on top and extend the flake with a turso-featured package output. If you'd rather not take the flake at all, #262 works without it — happy to reshuffle either way.