Skip to content

feat: add nix flake packaging - #150

Merged
Microck merged 3 commits into
mainfrom
feat/add-nix-flake
Jul 31, 2026
Merged

feat: add nix flake packaging#150
Microck merged 3 commits into
mainfrom
feat/add-nix-flake

Conversation

@Microck

@Microck Microck commented Jul 31, 2026

Copy link
Copy Markdown
Owner

what changed

adds first-class nix packaging for kagi-cli:

  • adds a reproducible flake.nix and flake.lock
  • exposes packages.default, apps.default, checks.kagi, devShells.default, and overlays.default
  • packages the existing Cargo project with rustPlatform.buildRustPackage
  • installs bash, zsh, and fish completions from the built binary
  • documents nix run and nix profile install

why

kagi-cli is already a good fit for nix: it is a locked Rust project that builds a standalone binary and uses rustls instead of OpenSSL. this gives NixOS and home-manager users a declarative install path without changing the existing installers or release workflow.

verification

  • cargo fmt --check
  • cargo check --workspace --all-targets --locked
  • cargo test --workspace --all-targets --locked
  • 273 tests passed, 13 live tests ignored

nix flake check was not run because nix is not installed in the verification environment.

implementation with Hermes, verified locally with the existing Rust toolchain.

Summary by CodeRabbit

  • New Features

    • Added Nix/NixOS installation support, including direct execution, profile installation, and flake integration.
    • Added a Nix package, runnable app, development shell, formatter, overlay, and package checks.
  • Documentation

    • Added setup instructions for using the application with Nix, NixOS, and home-manager.

Greptile Summary

Adds first-class Nix flake packaging for the Rust CLI.

  • Exposes default package, app, check, development shell, formatter, and overlay outputs.
  • Builds the existing Cargo project and generates shell completions when the build platform can execute target binaries.
  • Documents Nix execution, profile installation, NixOS, and Home Manager usage.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the prior cross-build issue is fixed by skipping target test execution when the build platform cannot execute host-platform binaries.

Important Files Changed

Filename Overview
flake.nix Defines per-system package, app, check, development shell, formatter, and exported overlay outputs.
nix/kagi.nix Packages the Cargo project, correctly guards tests and completion generation by target executability, and defines package metadata.
flake.lock Pins the nixpkgs, flake-utils, and systems inputs used by the new flake.
README.md Adds concise Nix run, profile installation, NixOS, and Home Manager guidance.
docs/guides/installation.mdx Adds Nix installation and authentication instructions to the installation guide.

Reviews (3): Last reviewed commit: "docs: add nix installation guide" | Re-trigger Greptile

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request adds Nix packaging for the Rust CLI. It defines a Nix derivation, exposes flake outputs for building and development, and documents Nix, NixOS, and home-manager installation methods.

Changes

Nix packaging

Layer / File(s) Summary
Rust package definition
nix/kagi.nix
The derivation builds kagi from Cargo metadata and locked dependencies. It runs tests, installs Bash, Zsh, and Fish completions, and defines package metadata.
Flake outputs and installation
flake.nix, README.md
The flake adds package, application, check, development shell, formatter, and overlay outputs. The README documents direct execution, profile installation, and NixOS or home-manager integration.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Release Metadata Consistency ✅ Passed Cargo.toml, Cargo.lock kagi, and npm/package.json all contain 0.16.0; CHANGELOG.md contains the exact heading ## [0.16.0].
Title check ✅ Passed The title clearly and concisely identifies the main change: adding Nix flake packaging.
Description check ✅ Passed The description explains the changes, rationale, verification results, and unavailable Nix verification; it omits some template sections but remains mostly complete.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/add-nix-flake

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.

Comment thread nix/kagi.nix Outdated
greptile-apps[bot]
greptile-apps Bot previously approved these changes Jul 31, 2026
@greptile-apps
greptile-apps Bot dismissed their stale review July 31, 2026 02:27

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

@Microck
Microck merged commit 184c344 into main Jul 31, 2026
8 checks passed
@Microck
Microck deleted the feat/add-nix-flake branch July 31, 2026 02:29
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.

1 participant