docs: add nixos-options MCP configuration
Some checks failed
Run nix flake check / flake-check (push) Failing after 13m51s
Some checks failed
Run nix flake check / flake-check (push) Failing after 13m51s
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
12
.mcp.json
Normal file
12
.mcp.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"mcpServers": {
|
||||
"nixos-options": {
|
||||
"command": "nix",
|
||||
"args": ["run", "git+https://git.t-juice.club/torjus/labmcp#nixos-options", "--", "serve"],
|
||||
"env": {
|
||||
"NIXOS_OPTIONS_DATABASE": "sqlite:///run/user/1000/labmcp/nixos-options.db"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
17
CLAUDE.md
17
CLAUDE.md
@@ -63,6 +63,23 @@ Examples:
|
||||
- `template2: add proxmox image configuration`
|
||||
- `terraform: add VM deployment configuration`
|
||||
|
||||
### NixOS Options Lookup
|
||||
|
||||
An MCP server is available for searching and looking up NixOS option documentation. This is useful when configuring new services or options for hosts.
|
||||
|
||||
**Session Setup:** At the start of each session, index the nixpkgs revision from `flake.lock` to ensure option documentation matches the project's nixpkgs version:
|
||||
|
||||
1. Read `flake.lock` and find the `nixpkgs` node's `rev` field
|
||||
2. Call `index_revision` with that git hash
|
||||
|
||||
**Usage Examples:**
|
||||
|
||||
- `search_options` - Search for options by name or description (e.g., query "nginx" or "postgresql")
|
||||
- `get_option` - Get full details for a specific option (e.g., `services.loki.configuration`)
|
||||
- `get_file` - Fetch the source file from nixpkgs that declares an option
|
||||
|
||||
This ensures documentation matches the exact nixpkgs version (currently NixOS 25.11) used by this flake.
|
||||
|
||||
## Architecture
|
||||
|
||||
### Directory Structure
|
||||
|
||||
Reference in New Issue
Block a user