feat: add nixpkgs-search binary with package search support

Add a new nixpkgs-search CLI that combines NixOS options search with
Nix package search functionality. This provides two MCP servers from
a single binary:
- `nixpkgs-search options serve` for NixOS options
- `nixpkgs-search packages serve` for Nix packages

Key changes:
- Add packages table to database schema (version 3)
- Add Package type and search methods to database layer
- Create internal/packages/ with indexer and parser for nix-env JSON
- Add MCP server mode (options/packages) with separate tool sets
- Add package handlers: search_packages, get_package
- Create cmd/nixpkgs-search with combined indexing support
- Update flake.nix with nixpkgs-search package (now default)
- Bump version to 0.2.0

The index command can index both options and packages together, or
use --no-packages/--no-options flags for partial indexing.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-04 17:12:41 +01:00
parent 9efcca217c
commit ea4c69bc23
17 changed files with 2559 additions and 63 deletions

View File

@@ -26,7 +26,14 @@
mainProgram = "hm-options";
description = "MCP server for Home Manager options search and query";
};
default = self.packages.${system}.nixos-options;
nixpkgs-search = pkgs.callPackage ./nix/package.nix {
src = ./.;
pname = "nixpkgs-search";
subPackage = "cmd/nixpkgs-search";
mainProgram = "nixpkgs-search";
description = "Search nixpkgs options and packages";
};
default = self.packages.${system}.nixpkgs-search;
});
devShells = forAllSystems (system: