Skip to content

feat: add nix flake #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ integrationtests/workspaces/clangd/.cache
CLAUDE.md*
.mcp.json
.goosehints

/result
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 67 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
description = "MCP Language Server - A Model Context Protocol server that runs and exposes a language server to LLMs";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
packages.default = pkgs.buildGoModule rec {
pname = "mcp-language-server";
version = "0.1.0";

src = ./.;

vendorHash = "sha256-WcYKtM8r9xALx68VvgRabMPq8XnubhTj6NAdtmaPa+g=";

# Only build the main package
subPackages = [ "." ];

ldflags = [
"-s"
"-w"
"-X main.version=${version}"
];

meta = with pkgs.lib; {
description = "MCP server that runs and exposes a language server to LLMs";
homepage = "https://github.com/isaacphi/mcp-language-server";
license = licenses.bsd3;
maintainers = [ ];
platforms = platforms.unix;
};

# Skip tests for now as they require external language servers
doCheck = false;
};

apps.default = {
type = "app";
program = "${self.packages.${system}.default}/bin/mcp-language-server";
};

devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
go
gopls
golangci-lint
delve
just
];

shellHook = ''
echo "MCP Language Server development shell"
echo "Available commands:"
echo " go build - Build the binary"
echo " go test - Run tests"
echo " just -l - List available just recipes"
'';
};
});
}