Skip to content

Commit b2c1f9b

Browse files
author
DJTBOT
committed
🤖 feat: load plugin env from secret files
What: - read plugin env values from files when paths exist Why: - support requiredEnv secrets without embedding values in Nix Tests: - nix flake check
1 parent 981c4da commit b2c1f9b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎nix/modules/home-manager/openclaw/config.nix‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,13 @@ let
8383
export PATH="${lib.makeBinPath pluginPackages}:$PATH"
8484
fi
8585
86-
${lib.concatStringsSep "\n" (map (entry: "export ${entry.key}=\"${entry.value}\"") pluginEnvAll)}
86+
${lib.concatStringsSep "\n" (map (entry: ''
87+
if [ -f "${entry.value}" ]; then
88+
export ${entry.key}="$(cat "${entry.value}")"
89+
else
90+
export ${entry.key}="${entry.value}"
91+
fi
92+
'') pluginEnvAll)}
8793
8894
exec "${gatewayPackage}/bin/openclaw" "$@"
8995
'';

0 commit comments

Comments
 (0)