Skip to content

Commit 2ea6216

Browse files
andreabadessoclaude
andcommitted
fix: include providers.anthropic.apiKeyFile in generated config
The apiKeyFile option was defined but never included in the generated clawdbot.json, causing the gateway to fail with "No API key found". Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent da842bb commit 2ea6216

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

nix/modules/home-manager/clawdbot.nix

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ let
5959
};
6060
};
6161

62+
mkProvidersConfig = inst: lib.optionalAttrs (inst.providers.anthropic.apiKeyFile != "") {
63+
providers = {
64+
anthropic = {
65+
apiKeyFile = inst.providers.anthropic.apiKeyFile;
66+
};
67+
};
68+
};
69+
6270
firstPartySources = let
6371
stepieteRev = "e4e2cac265de35175015cf1ae836b0b30dddd7b7";
6472
stepieteNarHash = "sha256-L8bKt5rK78dFP3ZoP1Oi1SSAforXVHZDsSiDO+NsvEE=";
@@ -735,9 +743,13 @@ let
735743
pluginPackages = pluginPackagesFor name;
736744
pluginEnvAll = pluginEnvAllFor name;
737745
baseConfig = mkBaseConfig inst.workspaceDir inst;
738-
mergedConfig = lib.recursiveUpdate
739-
(lib.recursiveUpdate baseConfig (lib.recursiveUpdate (mkTelegramConfig inst) (mkRoutingConfig inst)))
740-
inst.configOverrides;
746+
mergedConfig = lib.foldl' lib.recursiveUpdate {} [
747+
baseConfig
748+
(mkTelegramConfig inst)
749+
(mkRoutingConfig inst)
750+
(mkProvidersConfig inst)
751+
inst.configOverrides
752+
];
741753
configJson = builtins.toJSON mergedConfig;
742754
configFile = pkgs.writeText "clawdbot-${name}.json" configJson;
743755
gatewayWrapper = pkgs.writeShellScriptBin "clawdbot-gateway-${name}" ''

0 commit comments

Comments
 (0)