Compare commits
2 Commits
9fb3eebd8a
...
743e6afde3
| Author | SHA1 | Date | |
|---|---|---|---|
|
743e6afde3
|
|||
|
e327504f4e
|
@@ -55,6 +55,10 @@
|
|||||||
// {
|
// {
|
||||||
packages = inputs.nixpkgs.lib.recursiveUpdate blueprintOutputs.packages extraPackages;
|
packages = inputs.nixpkgs.lib.recursiveUpdate blueprintOutputs.packages extraPackages;
|
||||||
|
|
||||||
|
nixosModules = {
|
||||||
|
mcp-gateway = ./modules/mcp-gateway.nix;
|
||||||
|
};
|
||||||
|
|
||||||
overlays = {
|
overlays = {
|
||||||
default = import ./overlays {
|
default = import ./overlays {
|
||||||
inherit (blueprintOutputs) packages;
|
inherit (blueprintOutputs) packages;
|
||||||
|
|||||||
46
modules/mcp-gateway.nix
Normal file
46
modules/mcp-gateway.nix
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.services.mcp-gateway;
|
||||||
|
package = pkgs.mcp-gateway;
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
options.services.mcp-gateway = {
|
||||||
|
enable = lib.mkEnableOption "MCP Gateway user service";
|
||||||
|
|
||||||
|
package = lib.mkOption {
|
||||||
|
type = lib.types.package;
|
||||||
|
default = package;
|
||||||
|
description = "The mcp-gateway package to use.";
|
||||||
|
};
|
||||||
|
|
||||||
|
configFile = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "%h/.config/mcp-gateway/gateway.yaml";
|
||||||
|
description = "Path to the mcp-gateway configuration file.";
|
||||||
|
};
|
||||||
|
|
||||||
|
settings = lib.mkOption {
|
||||||
|
type = with lib.types; attrsOf (attrsOf anything);
|
||||||
|
default = {};
|
||||||
|
description = "Extra systemd service configuration options.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
systemd.user.services.mcp-gateway = {
|
||||||
|
description = "MCP Gateway";
|
||||||
|
wantedBy = [ "default.target" ];
|
||||||
|
wants = [ "network-online.target" ];
|
||||||
|
after = [ "network-online.target" ];
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "simple";
|
||||||
|
ExecStart = "${cfg.package}/bin/mcp-gateway --config ${cfg.configFile} serve";
|
||||||
|
Restart = "on-failure";
|
||||||
|
RestartSec = 5;
|
||||||
|
} // cfg.settings;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user