From 743e6afde37ae0f0245fadeed02dc2e67a2e95b2 Mon Sep 17 00:00:00 2001 From: Alexander Miroshnichenko Date: Wed, 6 May 2026 18:23:22 +0300 Subject: [PATCH] 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. --- modules/mcp-gateway.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/mcp-gateway.nix b/modules/mcp-gateway.nix index cae5ebf..e465e0a 100644 --- a/modules/mcp-gateway.nix +++ b/modules/mcp-gateway.nix @@ -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" ];