{ pkgs }: let sources = import ./_sources.nix { inherit pkgs; }; json = pkgs.formats.json { }; ponytailVersion = "4.9.0"; context7Headers = pkgs.writeShellScript "context7-http-headers" '' set -euo pipefail CONTEXT7_KEY_FILE="''${XDG_CONFIG_HOME:-$HOME/.config}/context7/api-key" CONTEXT7_KEY="$(< "$CONTEXT7_KEY_FILE")" exec ${pkgs.jq}/bin/jq --null-input --compact-output \ --arg authorization "Bearer $CONTEXT7_KEY" '{ Authorization: $authorization }' ''; codexHooks = { SessionStart = [ { hooks = [ { type = "command"; command = "${pkgs.bash}/bin/bash ${sources.herdr}/src/integration/assets/codex/herdr-agent-state.sh session"; timeout = 10; } ]; } ]; }; in { inherit sources ponytailVersion context7Headers; inherit codexHooks; codexCache = ".codex/plugins/cache/nix-managed/ponytail/${ponytailVersion}"; marketplace = pkgs.runCommand "ai-marketplace" { } '' mkdir -p "$out/.agents/plugins" "$out/plugins" ln -s ${sources.ponytail} "$out/plugins/ponytail" cp ${ json.generate "ai-marketplace.json" { name = "nix-managed"; plugins = [ { name = "ponytail"; source = { source = "local"; path = "./plugins/ponytail"; }; policy = { installation = "AVAILABLE"; authentication = "ON_INSTALL"; }; category = "Productivity"; } ]; } } "$out/.agents/plugins/marketplace.json" ''; skills = { context7-mcp = ../skills/context7-mcp; nixos-maintainer = ../skills/nixos-maintainer; herdr = "${sources.herdr}/skills/herdr"; }; servers = { context7.url = "https://mcp.context7.com/mcp"; nixos.command = "${pkgs.mcp-nixos}/bin/mcp-nixos"; openaiDeveloperDocs.url = "https://developers.openai.com/mcp"; }; }