refactor: centralize Nix-managed Codex assets and integrations
This commit is contained in:
1 parent
81dc673ac2
commit
d7a0acf0a9
7 files changed
+167
-106
No files matched your search
@@ -0,0 +1,64 @@
|
||||
{ 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";
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user