feat: project structure and nix build setup

- Add CLI entry point with urfave/cli/v2 (serve, index, list, search commands)
- Add database interface and implementations for PostgreSQL and SQLite
- Add schema versioning with automatic recreation on version mismatch
- Add MCP protocol types and server scaffold
- Add NixOS option types
- Configure flake.nix with devShell and buildGoModule package

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-03 17:30:11 +01:00
parent 740b846f0c
commit 6326b3a3c1
11 changed files with 1921 additions and 6 deletions

View File

@@ -1,15 +1,64 @@
{
description = "A very basic flake";
description = "LabMCP - Collection of MCP servers";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs = { self, nixpkgs }: {
outputs = { self, nixpkgs }:
let
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
pkgsFor = system: nixpkgs.legacyPackages.${system};
in
{
packages = forAllSystems (system:
let
pkgs = pkgsFor system;
in
{
nixos-options = pkgs.buildGoModule {
pname = "nixos-options-mcp";
version = "0.1.0";
src = ./.;
packages.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hello;
vendorHash = null; # Will be set after first build
packages.x86_64-linux.default = self.packages.x86_64-linux.hello;
subPackages = [ "cmd/nixos-options" ];
};
meta = with pkgs.lib; {
description = "MCP server for NixOS options search and query";
homepage = "https://git.t-juice.club/torjus/labmcp";
license = licenses.mit;
maintainers = [ ];
mainProgram = "nixos-options";
};
};
default = self.packages.${system}.nixos-options;
});
devShells = forAllSystems (system:
let
pkgs = pkgsFor system;
in
{
default = pkgs.mkShell {
buildInputs = with pkgs; [
go_1_24
gopls
gotools
go-tools
golangci-lint
postgresql
sqlite
];
shellHook = ''
echo "LabMCP development shell"
echo "Go version: $(go version)"
'';
};
});
};
}