From 34261f18f11f118ee6e002d1067bcc86a51bffaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Abadesso?= Date: Sat, 24 Jan 2026 00:35:47 -0300 Subject: [PATCH 1/5] fix: Linux compatibility updates - Use portable paths (run mkdir/ln) instead of hardcoded /bin paths - Update config format for clawdbot schema changes - Disable memory slot on Linux (plugins.slots.memory = "none") - Update to upstream clawdbot main (includes memory slot none fix) --- nix/modules/home-manager/clawdbot.nix | 36 ++++++++++++++++----------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/nix/modules/home-manager/clawdbot.nix b/nix/modules/home-manager/clawdbot.nix index 1b59d8b3..5a3181bd 100644 --- a/nix/modules/home-manager/clawdbot.nix +++ b/nix/modules/home-manager/clawdbot.nix @@ -33,14 +33,20 @@ let } ]; }; + } // lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux { + # Disable memory slot on Linux - memory-core plugin not available for headless servers + # See: https://github.com/clawdbot/clawdbot/blob/main/docs/concepts/memory.md + plugins.slots.memory = "none"; }; mkTelegramConfig = inst: lib.optionalAttrs inst.providers.telegram.enable { - telegram = { - enabled = true; - tokenFile = inst.providers.telegram.botTokenFile; - allowFrom = inst.providers.telegram.allowFrom; - groups = inst.providers.telegram.groups; + channels = { + telegram = { + enabled = true; + tokenFile = inst.providers.telegram.botTokenFile; + allowFrom = inst.providers.telegram.allowFrom; + groups = inst.providers.telegram.groups; + }; }; }; @@ -48,7 +54,7 @@ let messages = { queue = { mode = inst.routing.queue.mode; - byProvider = inst.routing.queue.byProvider; + byChannel = inst.routing.queue.byProvider; }; }; }; @@ -996,13 +1002,13 @@ in { firstParty = { summarize.enable = lib.mkOption { type = lib.types.bool; - default = true; - description = "Enable the summarize plugin (first-party)."; + default = pkgs.stdenv.hostPlatform.isDarwin; # macOS-only: uses macOS-specific dependencies + description = "Enable the summarize plugin (first-party, macOS only)."; }; peekaboo.enable = lib.mkOption { type = lib.types.bool; - default = true; - description = "Enable the peekaboo plugin (first-party)."; + default = pkgs.stdenv.hostPlatform.isDarwin; # macOS-only: screenshot tool + description = "Enable the peekaboo plugin (first-party, macOS only)."; }; oracle.enable = lib.mkOption { type = lib.types.bool; @@ -1022,7 +1028,7 @@ in { camsnap.enable = lib.mkOption { type = lib.types.bool; default = false; - description = "Enable the camsnap plugin (first-party)."; + description = "Enable the camsnap plugin (first-party, macOS only)."; }; gogcli.enable = lib.mkOption { type = lib.types.bool; @@ -1042,7 +1048,7 @@ in { imsg.enable = lib.mkOption { type = lib.types.bool; default = false; - description = "Enable the imsg plugin (first-party)."; + description = "Enable the imsg plugin (first-party, macOS only)."; }; }; @@ -1176,13 +1182,13 @@ in { ); home.activation.clawdbotDirs = lib.hm.dag.entryAfter [ "writeBoundary" ] '' - /bin/mkdir -p ${lib.concatStringsSep " " (lib.concatMap (item: item.dirs) instanceConfigs)} - ${lib.optionalString (pluginStateDirsAll != []) "/bin/mkdir -p ${lib.concatStringsSep " " pluginStateDirsAll}"} + run mkdir -p ${lib.concatStringsSep " " (lib.concatMap (item: item.dirs) instanceConfigs)} + ${lib.optionalString (pluginStateDirsAll != []) "run mkdir -p ${lib.concatStringsSep " " pluginStateDirsAll}"} ''; home.activation.clawdbotConfigFiles = lib.hm.dag.entryAfter [ "clawdbotDirs" ] '' set -euo pipefail - ${lib.concatStringsSep "\n" (map (item: "/bin/ln -sfn ${item.configFile} ${item.configPath}") instanceConfigs)} + ${lib.concatStringsSep "\n" (map (item: "run ln -sfn ${item.configFile} ${item.configPath}") instanceConfigs)} ''; home.activation.clawdbotPluginGuard = lib.hm.dag.entryAfter [ "writeBoundary" ] '' From f1ad09ec30fff4d3b15fa5bc2573d3864f9f9a53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Abadesso?= Date: Sat, 24 Jan 2026 01:46:18 -0300 Subject: [PATCH 2/5] fix: include extensions directory in gateway install --- nix/scripts/gateway-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/scripts/gateway-install.sh b/nix/scripts/gateway-install.sh index cd09ff94..f1ef29b6 100755 --- a/nix/scripts/gateway-install.sh +++ b/nix/scripts/gateway-install.sh @@ -2,7 +2,7 @@ set -e mkdir -p "$out/lib/clawdbot" "$out/bin" -cp -r dist node_modules package.json ui "$out/lib/clawdbot/" +cp -r dist node_modules package.json ui extensions "$out/lib/clawdbot/" if [ -z "${STDENV_SETUP:-}" ]; then echo "STDENV_SETUP is not set" >&2 From da842bbec01030958d9995c9058e19e0e6c9131b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Abadesso?= Date: Sat, 24 Jan 2026 02:00:52 -0300 Subject: [PATCH 3/5] fix: include docs directory in gateway install for templates --- nix/scripts/gateway-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nix/scripts/gateway-install.sh b/nix/scripts/gateway-install.sh index f1ef29b6..8f6d57a8 100755 --- a/nix/scripts/gateway-install.sh +++ b/nix/scripts/gateway-install.sh @@ -2,7 +2,7 @@ set -e mkdir -p "$out/lib/clawdbot" "$out/bin" -cp -r dist node_modules package.json ui extensions "$out/lib/clawdbot/" +cp -r dist node_modules package.json ui extensions docs "$out/lib/clawdbot/" if [ -z "${STDENV_SETUP:-}" ]; then echo "STDENV_SETUP is not set" >&2 From c8f79d6c756dcc0923b03b9385609cad09e0b793 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Abadesso?= Date: Sat, 24 Jan 2026 13:10:45 -0300 Subject: [PATCH 4/5] fix: add auth.profiles config for anthropic provider When providers.anthropic.apiKeyFile is set, generate the correct auth.profiles structure in clawdbot.json. The API key itself is passed via ANTHROPIC_API_KEY env var in the gateway wrapper. Co-Authored-By: Claude Opus 4.5 --- nix/modules/home-manager/clawdbot.nix | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/nix/modules/home-manager/clawdbot.nix b/nix/modules/home-manager/clawdbot.nix index 5a3181bd..0944c940 100644 --- a/nix/modules/home-manager/clawdbot.nix +++ b/nix/modules/home-manager/clawdbot.nix @@ -59,6 +59,17 @@ let }; }; + mkAuthConfig = inst: lib.optionalAttrs (inst.providers.anthropic.apiKeyFile != "") { + auth = { + profiles = { + "anthropic:default" = { + provider = "anthropic"; + mode = "api_key"; + }; + }; + }; + }; + firstPartySources = let stepieteRev = "e4e2cac265de35175015cf1ae836b0b30dddd7b7"; stepieteNarHash = "sha256-L8bKt5rK78dFP3ZoP1Oi1SSAforXVHZDsSiDO+NsvEE="; @@ -735,9 +746,13 @@ let pluginPackages = pluginPackagesFor name; pluginEnvAll = pluginEnvAllFor name; baseConfig = mkBaseConfig inst.workspaceDir inst; - mergedConfig = lib.recursiveUpdate - (lib.recursiveUpdate baseConfig (lib.recursiveUpdate (mkTelegramConfig inst) (mkRoutingConfig inst))) - inst.configOverrides; + mergedConfig = lib.foldl' lib.recursiveUpdate {} [ + baseConfig + (mkTelegramConfig inst) + (mkRoutingConfig inst) + (mkAuthConfig inst) + inst.configOverrides + ]; configJson = builtins.toJSON mergedConfig; configFile = pkgs.writeText "clawdbot-${name}.json" configJson; gatewayWrapper = pkgs.writeShellScriptBin "clawdbot-gateway-${name}" '' From f356de3bf05a5d28fc08f35ce62b706fa9450091 Mon Sep 17 00:00:00 2001 From: Clawdbot Helper Date: Sun, 25 Jan 2026 13:35:12 +0100 Subject: [PATCH 5/5] feat: add manageConfig and manageDocuments options --- nix/modules/home-manager/clawdbot.nix | 32 ++++++++++++++++++--------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/nix/modules/home-manager/clawdbot.nix b/nix/modules/home-manager/clawdbot.nix index 0944c940..e779e0be 100644 --- a/nix/modules/home-manager/clawdbot.nix +++ b/nix/modules/home-manager/clawdbot.nix @@ -897,6 +897,18 @@ in { default = pkgs.clawdbot; description = "Clawdbot batteries-included package."; }; + + manageConfig = lib.mkOption { + type = lib.types.bool; + default = true; + description = "Manage configuration files (clawdbot.json) via Home Manager."; + }; + + manageDocuments = lib.mkOption { + type = lib.types.bool; + default = true; + description = "Manage document and skill files via Home Manager."; + }; toolNames = lib.mkOption { type = lib.types.nullOr (lib.types.listOf lib.types.str); @@ -1169,7 +1181,7 @@ in { ); home.file = - (lib.listToAttrs (map (item: item.homeFile) instanceConfigs)) + (if cfg.manageConfig then (lib.listToAttrs (map (item: item.homeFile) instanceConfigs)) else {}) // (lib.optionalAttrs (pkgs.stdenv.hostPlatform.isDarwin && appPackage != null && cfg.installApp) { "Applications/Clawdbot.app" = { source = "${appPackage}/Applications/Clawdbot.app"; @@ -1178,10 +1190,10 @@ in { }; }) // (lib.listToAttrs appInstalls) - // documentsFiles - // skillFiles - // pluginSkillsFiles - // pluginConfigFiles + // (if cfg.manageDocuments then documentsFiles else {}) + // (if cfg.manageDocuments then skillFiles else {}) + // (if cfg.manageDocuments then pluginSkillsFiles else {}) + // (if cfg.manageDocuments then pluginConfigFiles else {}) // (lib.optionalAttrs cfg.reloadScript.enable { ".local/bin/clawdbot-reload" = { executable = true; @@ -1189,7 +1201,7 @@ in { }; }); - home.activation.clawdbotDocumentGuard = lib.mkIf documentsEnabled ( + home.activation.clawdbotDocumentGuard = lib.mkIf (documentsEnabled && cfg.manageDocuments) ( lib.hm.dag.entryBefore [ "writeBoundary" ] '' set -euo pipefail ${documentsGuard} @@ -1201,15 +1213,15 @@ in { ${lib.optionalString (pluginStateDirsAll != []) "run mkdir -p ${lib.concatStringsSep " " pluginStateDirsAll}"} ''; - home.activation.clawdbotConfigFiles = lib.hm.dag.entryAfter [ "clawdbotDirs" ] '' + home.activation.clawdbotConfigFiles = lib.mkIf cfg.manageConfig (lib.hm.dag.entryAfter [ "clawdbotDirs" ] '' set -euo pipefail ${lib.concatStringsSep "\n" (map (item: "run ln -sfn ${item.configFile} ${item.configPath}") instanceConfigs)} - ''; + ''); - home.activation.clawdbotPluginGuard = lib.hm.dag.entryAfter [ "writeBoundary" ] '' + home.activation.clawdbotPluginGuard = lib.mkIf cfg.manageDocuments (lib.hm.dag.entryAfter [ "writeBoundary" ] '' set -euo pipefail ${pluginGuards} - ''; + ''); home.activation.clawdbotAppDefaults = lib.mkIf (pkgs.stdenv.hostPlatform.isDarwin && appDefaults != {}) ( lib.hm.dag.entryAfter [ "writeBoundary" ] ''