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
This commit is contained in:
2026-05-06 18:38:47 +03:00
parent 743e6afde3
commit ea9cf8b588
3 changed files with 18 additions and 50 deletions

View File

@@ -27,6 +27,24 @@ rustPlatform.buildRustPackage rec {
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; {