feat(pi): add pi-subagents extension
This commit is contained in:
@@ -1,9 +1,8 @@
|
|||||||
{
|
{ lib
|
||||||
lib,
|
, pkgs
|
||||||
pkgs,
|
, config
|
||||||
config,
|
, namespace
|
||||||
namespace,
|
, ...
|
||||||
...
|
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf;
|
||||||
@@ -18,6 +17,7 @@ let
|
|||||||
# writing other fields (current model, etc.) without us clobbering them.
|
# writing other fields (current model, etc.) without us clobbering them.
|
||||||
piPackages = [
|
piPackages = [
|
||||||
"https://gitea.va.reichard.io/evan/pi-lsp.git@main"
|
"https://gitea.va.reichard.io/evan/pi-lsp.git@main"
|
||||||
|
"https://gitea.va.reichard.io/evan/pi-subagents.git@main"
|
||||||
"https://gitea.va.reichard.io/evan/pi-statusline.git@main"
|
"https://gitea.va.reichard.io/evan/pi-statusline.git@main"
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -35,15 +35,19 @@ let
|
|||||||
];
|
];
|
||||||
|
|
||||||
piAuthJqRawfiles = lib.concatStringsSep " \\\n " (
|
piAuthJqRawfiles = lib.concatStringsSep " \\\n " (
|
||||||
map (
|
map
|
||||||
|
(
|
||||||
auth: ''--rawfile ${auth.jqVar} "${config.sops.secrets.${auth.secretName}.path}"''
|
auth: ''--rawfile ${auth.jqVar} "${config.sops.secrets.${auth.secretName}.path}"''
|
||||||
) piAuthApiKeys
|
)
|
||||||
|
piAuthApiKeys
|
||||||
);
|
);
|
||||||
|
|
||||||
piAuthJqFilter = lib.concatStringsSep " | " (
|
piAuthJqFilter = lib.concatStringsSep " | " (
|
||||||
map (
|
map
|
||||||
|
(
|
||||||
auth: ''.["${auth.provider}"] = { type: "api_key", key: ($'' + auth.jqVar + ''| rtrimstr("\n")) }''
|
auth: ''.["${auth.provider}"] = { type: "api_key", key: ($'' + auth.jqVar + ''| rtrimstr("\n")) }''
|
||||||
) piAuthApiKeys
|
)
|
||||||
|
piAuthApiKeys
|
||||||
);
|
);
|
||||||
|
|
||||||
piAuthMergeScript = pkgs.writeShellScript "pi-auth-merge" ''
|
piAuthMergeScript = pkgs.writeShellScript "pi-auth-merge" ''
|
||||||
@@ -116,10 +120,12 @@ in
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
// lib.listToAttrs (
|
// lib.listToAttrs (
|
||||||
map (auth: {
|
map
|
||||||
|
(auth: {
|
||||||
name = auth.secretName;
|
name = auth.secretName;
|
||||||
value.sopsFile = auth.sopsFile;
|
value.sopsFile = auth.sopsFile;
|
||||||
}) piAuthApiKeys
|
})
|
||||||
|
piAuthApiKeys
|
||||||
);
|
);
|
||||||
templates."pi-models.json" = {
|
templates."pi-models.json" = {
|
||||||
path = "${config.home.homeDirectory}/.pi/agent/models.json";
|
path = "${config.home.homeDirectory}/.pi/agent/models.json";
|
||||||
|
|||||||
Reference in New Issue
Block a user