pi: move extensions into custom-extensions/, register via settings.extensions

Relocate the bundled extensions out of extensions/ into custom-extensions/
and pull their packaging out of default.nix into a focused extensions.nix
module.

Register them through programs.pi-coding-agent.settings.extensions as a
buildNpmPackage derivation, pointing pi directly at the nix-store-backed
path, rather than symlinking into place with home.file.

Assisted-by: pi (claude-opus-4-8)
This commit is contained in:
Gabriel Fontes
2026-06-24 12:02:37 -03:00
parent 74d1dd85a6
commit 77b43f87f5
8 changed files with 40 additions and 32 deletions
+2 -32
View File
@@ -1,6 +1,7 @@
{pkgs, ...}: {
{
imports = [
./theme.nix
./extensions.nix
];
programs.pi-coding-agent = {
@@ -22,42 +23,11 @@
];
enableInstallTelemetry = false;
enableAnalytics = false;
gondolin = {
httpProxy = {
allowedHosts = ["api.github.com" "firefly.m7.rs"];
secrets = {
GITHUB_TOKEN = {
hosts = ["api.github.com"];
cmd = "gh auth token";
};
FIREFLY_TOKEN = {
hosts = ["firefly.m7.rs"];
cmd = "pass firefly.m7.rs/pi-pat";
};
};
};
};
};
keybindings = {
"app.editor.external" = ["alt+e"];
};
};
home.sessionVariables.PI_SKIP_VERSION_CHECK = true;
home.file.".pi/agent/skills".source = ./skills;
home.file.".pi/agent/extensions".source = pkgs.buildNpmPackage {
pname = "pi-extensions";
version = "0-unstable";
src = ./extensions;
npmDepsHash = "sha256-odIhyMMSPBTtskV52CTEBGpMPVzUkBFLj6n+9JZCNZo=";
npmDepsFetcherVersion = 2;
dontNpmBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r . $out/
runHook postInstall
'';
};
home.packages = [pkgs.qemu];
}
+38
View File
@@ -0,0 +1,38 @@
{pkgs, ...}: {
programs.pi-coding-agent = {
settings = {
extensions = [
(pkgs.buildNpmPackage {
pname = "custom-extensions";
version = "0-unstable";
src = ./custom-extensions;
npmDepsHash = "sha256-odIhyMMSPBTtskV52CTEBGpMPVzUkBFLj6n+9JZCNZo=";
npmDepsFetcherVersion = 2;
dontNpmBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r . $out/
runHook postInstall
'';
})
];
gondolin = {
httpProxy = {
allowedHosts = ["api.github.com" "firefly.m7.rs"];
secrets = {
GITHUB_TOKEN = {
hosts = ["api.github.com"];
cmd = "gh auth token";
};
FIREFLY_TOKEN = {
hosts = ["firefly.m7.rs"];
cmd = "pass firefly.m7.rs/pi-pat";
};
};
};
};
};
};
home.packages = [pkgs.qemu];
}