Files
millerson-overlay.nix/packages/mcp-gateway/package.nix
Alexander Miroshnichenko ea9cf8b588 feat(mcp-gateway): add systemd user unit file to package
Install mcp-gateway.service to $out/lib/systemd/user/ so it can be
activated via systemd.user.packages. The service runs:
  mcp-gateway --config ~/.config/mcp-gateway/gateway.yaml serve
2026-05-06 18:38:47 +03:00

60 lines
1.3 KiB
Nix

{
lib,
rustPlatform,
fetchFromGitHub,
pkg-config,
openssl,
}:
rustPlatform.buildRustPackage rec {
pname = "mcp-gateway";
version = "2.11.0";
src = fetchFromGitHub {
owner = "MikkoParkkola";
repo = "mcp-gateway";
rev = "v${version}";
hash = "sha256-7IALz7hOnCeKtiEm8b3M7v5oy4hw173viyhNeqQIhTI=";
};
cargoHash = "sha256-B5HRETFryzLqQhdIqRFj0apZS0wMggW2MHE2VsbB22Y=";
nativeBuildInputs = [ pkg-config ];
buildInputs = [
openssl
];
doCheck = false;
postInstall = ''
install -Dm644 /dev/stdout $out/lib/systemd/user/mcp-gateway.service <<EOF
[Unit]
Description=MCP Gateway
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
ExecStart=%h/.config/mcp-gateway/mcp-gateway --config %h/.config/mcp-gateway/gateway.yaml serve
Restart=on-failure
RestartSec=5
[Install]
WantedBy=default.target
EOF
'';
passthru.category = "MCP Servers";
meta = with lib; {
description = "Universal Model Context Protocol gateway that sits between AI client and MCP tools/servers";
homepage = "https://github.com/MikkoParkkola/mcp-gateway";
changelog = "https://github.com/MikkoParkkola/mcp-gateway/releases/tag/v${version}";
license = licenses.mit;
sourceProvenance = with sourceTypes; [ fromSource ];
mainProgram = "mcp-gateway";
platforms = platforms.all;
};
}