docs: add NixOS module documentation to README
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
54
README.md
54
README.md
@@ -148,6 +148,60 @@ When running as an MCP server, the following tools are available:
|
||||
| `list_revisions` | List all indexed revisions |
|
||||
| `delete_revision` | Delete an indexed revision |
|
||||
|
||||
## NixOS Module
|
||||
|
||||
A NixOS module is provided for running the MCP server as a systemd service.
|
||||
|
||||
```nix
|
||||
{
|
||||
inputs.labmcp.url = "github:torjus/labmcp";
|
||||
|
||||
outputs = { self, nixpkgs, labmcp }: {
|
||||
nixosConfigurations.myhost = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
labmcp.nixosModules.nixos-options-mcp
|
||||
{
|
||||
services.nixos-options-mcp = {
|
||||
enable = true;
|
||||
indexOnStart = [ "nixos-unstable" ];
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
### Module Options
|
||||
|
||||
| Option | Type | Default | Description |
|
||||
|--------|------|---------|-------------|
|
||||
| `enable` | bool | `false` | Enable the service |
|
||||
| `package` | package | from flake | Package to use |
|
||||
| `database.type` | enum | `"sqlite"` | `"sqlite"` or `"postgres"` |
|
||||
| `database.name` | string | `"nixos-options.db"` | SQLite database filename |
|
||||
| `database.connectionString` | string | `""` | PostgreSQL connection URL |
|
||||
| `indexOnStart` | list of string | `[]` | Revisions to index on service start |
|
||||
| `user` | string | `"nixos-options-mcp"` | User to run the service as |
|
||||
| `group` | string | `"nixos-options-mcp"` | Group to run the service as |
|
||||
| `dataDir` | path | `/var/lib/nixos-options-mcp` | Directory for data storage |
|
||||
|
||||
### PostgreSQL Example
|
||||
|
||||
```nix
|
||||
{
|
||||
services.nixos-options-mcp = {
|
||||
enable = true;
|
||||
database = {
|
||||
type = "postgres";
|
||||
connectionString = "postgres://nixos:nixos@localhost/nixos_options?sslmode=disable";
|
||||
};
|
||||
indexOnStart = [ "nixos-unstable" "nixos-24.11" ];
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user