Add langdock api key env var on work mode

This commit is contained in:
Martin Pander
2026-07-23 16:06:38 +02:00
parent 5ed9fdc4bd
commit 784ea6bcea

View File

@@ -88,5 +88,14 @@ in
# Link the generated config to the expected location # Link the generated config to the expected location
xdg.configFile."opencode/opencode.json".source = config.lib.file.mkOutOfStoreSymlink config.sops.templates."opencode/opencode.json".path; xdg.configFile."opencode/opencode.json".source = config.lib.file.mkOutOfStoreSymlink config.sops.templates."opencode/opencode.json".path;
# Export the decrypted langdock API key as an env var (work config only).
# The secret lives in a runtime file, so we read it at shell startup rather
# than baking it into the Nix store via home.sessionVariables.
programs.zsh.initContent = lib.mkIf cfg.workMode ''
if [ -r "${config.sops.secrets.langdock_api_key.path}" ]; then
export LANGDOCK_API_KEY="$(cat "${config.sops.secrets.langdock_api_key.path}")"
fi
'';
}; };
} }