fix: scope workflow credentials to callers

This commit is contained in:
kiri committed 2026-09-06 00:23:19 +02:00
1 parent de068d173c
commit 422a1eacc3
2 files changed
+27 -7

No files matched your search

+13 -1
View File
@@ -7,6 +7,18 @@ in
flake.modules.nixos.ai =
{ pkgs, ... }:
let
context7Headers = pkgs.writeShellScript "context7-http-headers" ''
set -euo pipefail
CONTEXT7_KEY_FILE="''${XDG_CONFIG_HOME:-$HOME/.config}/context7/api-key"
[[ -r "$CONTEXT7_KEY_FILE" ]]
CONTEXT7_KEY="$(< "$CONTEXT7_KEY_FILE")"
exec ${pkgs.jq}/bin/jq --null-input --compact-output \
--arg authorization "Bearer $CONTEXT7_KEY" \
'{ Authorization: $authorization }'
'';
codexConfig = (pkgs.formats.toml { }).generate "codex-config.toml" {
model = "gpt-5.6-sol";
model_reasoning_effort = "high";
@@ -29,7 +41,7 @@ in
mcp_servers = {
context7 = {
url = "https://mcp.context7.com/mcp";
env_http_headers.CONTEXT7_API_KEY = "CONTEXT7_API_KEY";
http_headers_helper = "${context7Headers}";
};
nixos = {
command = "${pkgs.uv}/bin/uvx";