feat(pi): add pi-subagents extension

This commit is contained in:
2026-05-12 08:41:06 -04:00
parent 9ec2d61fcc
commit 9824728ccb

View File

@@ -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}"'' (
) piAuthApiKeys auth: ''--rawfile ${auth.jqVar} "${config.sops.secrets.${auth.secretName}.path}"''
)
piAuthApiKeys
); );
piAuthJqFilter = lib.concatStringsSep " | " ( piAuthJqFilter = lib.concatStringsSep " | " (
map ( map
auth: ''.["${auth.provider}"] = { type: "api_key", key: ($'' + auth.jqVar + ''| rtrimstr("\n")) }'' (
) piAuthApiKeys auth: ''.["${auth.provider}"] = { type: "api_key", key: ($'' + auth.jqVar + ''| rtrimstr("\n")) }''
)
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
name = auth.secretName; (auth: {
value.sopsFile = auth.sopsFile; name = auth.secretName;
}) piAuthApiKeys value.sopsFile = auth.sopsFile;
})
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";