From 53addc0ed130ee5d76e3d065ccbe9ed0df9bfe1f Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Fri, 3 Apr 2026 01:33:18 -0700 Subject: [PATCH] Remove pinned UID for mcp user UID 995 conflicted with sshd on orion. Let NixOS auto-assign the UID for the mcp system user. Use systemd's %U specifier for XDG_RUNTIME_DIR instead of the hardcoded UID. Co-Authored-By: Claude Opus 4.6 (1M context) --- configs/mcp.nix | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/configs/mcp.nix b/configs/mcp.nix index e0de34a..8353b08 100644 --- a/configs/mcp.nix +++ b/configs/mcp.nix @@ -4,13 +4,9 @@ # and a systemd service for the agent daemon. { pkgs, ... }: -let - mcpUid = 995; -in { users.users.mcp = { isSystemUser = true; - uid = mcpUid; # Pin UID so systemd Environment references stay stable. group = "mcp"; home = "/srv/mcp"; shell = pkgs.shadow; # nologin equivalent @@ -42,7 +38,7 @@ in Group = "mcp"; Environment = [ "HOME=/srv/mcp" - "XDG_RUNTIME_DIR=/run/user/${toString mcpUid}" + "XDG_RUNTIME_DIR=/run/user/%U" "PATH=/run/current-system/sw/bin:/usr/local/bin" ];