fix(mcp-gateway): change to user systemd service
Use systemd.user.services instead of systemd.services, default config to ~/.config/mcp-gateway/gateway.yaml, and wantedBy default.target.
This commit is contained in:
@@ -7,7 +7,7 @@ in
|
||||
|
||||
{
|
||||
options.services.mcp-gateway = {
|
||||
enable = lib.mkEnableOption "MCP Gateway service";
|
||||
enable = lib.mkEnableOption "MCP Gateway user service";
|
||||
|
||||
package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
@@ -16,22 +16,22 @@ in
|
||||
};
|
||||
|
||||
configFile = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
default = "/etc/mcp-gateway/gateway.yaml";
|
||||
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 = "Configuration options for the systemd service.";
|
||||
description = "Extra systemd service configuration options.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
systemd.services.mcp-gateway = {
|
||||
systemd.user.services.mcp-gateway = {
|
||||
description = "MCP Gateway";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
wantedBy = [ "default.target" ];
|
||||
wants = [ "network-online.target" ];
|
||||
after = [ "network-online.target" ];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user