mirror of
https://github.com/itme-brain/nixos.git
synced 2026-05-08 06:50:11 -04:00
updated
This commit is contained in:
parent
0125273b57
commit
9feb01d2d6
2 changed files with 27 additions and 7 deletions
|
|
@ -13,12 +13,14 @@ in
|
|||
vimAlias = true;
|
||||
vimdiffAlias = true;
|
||||
extraPackages = with pkgs; [
|
||||
lazygit
|
||||
gcc
|
||||
cargo
|
||||
rustc
|
||||
gcc
|
||||
|
||||
fzf
|
||||
fd
|
||||
ripgrep
|
||||
bat
|
||||
];
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -18,21 +18,39 @@ in
|
|||
|
||||
home.sessionPath = [ "${npmGlobal}/bin" ];
|
||||
|
||||
home.file.".pi/agent" = {
|
||||
source = ./agent;
|
||||
recursive = true;
|
||||
};
|
||||
|
||||
programs.bash.initExtra = ''
|
||||
export LLAMACPP_API_KEY=$(cat /run/secrets/LLAMA_API_KEY)
|
||||
'';
|
||||
|
||||
home.activation.installPiCodingAgent = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
PATH="${pkgs.nodejs_20}/bin:$PATH"
|
||||
agentDir="${config.home.homeDirectory}/.pi/agent"
|
||||
run mkdir -p ${npmGlobal}
|
||||
run mkdir -p "${config.home.homeDirectory}/.pi"
|
||||
run mkdir -p "$agentDir"
|
||||
if [ -e "$agentDir" ]; then
|
||||
run chmod -R u+w "$agentDir"
|
||||
run find "$agentDir" -mindepth 1 -maxdepth 1 -exec rm -rf {} +
|
||||
fi
|
||||
run cp -R ${./agent}/. "$agentDir"/
|
||||
run chmod -R u+w "$agentDir"
|
||||
if ! run ${pkgs.nodejs_20}/bin/npm install -g --prefix ${npmGlobal} @mariozechner/pi-coding-agent@${piVersion}; then
|
||||
warnEcho "pi-coding-agent install failed (offline or registry error)"
|
||||
fi
|
||||
|
||||
for ext in "$agentDir"/extensions/*; do
|
||||
if [ -f "$ext/package.json" ]; then
|
||||
if [ -f "$ext/package-lock.json" ]; then
|
||||
if ! run ${pkgs.nodejs_20}/bin/npm ci --prefix "$ext"; then
|
||||
warnEcho "pi extension dependency install failed for $ext"
|
||||
fi
|
||||
else
|
||||
if ! run ${pkgs.nodejs_20}/bin/npm install --prefix "$ext"; then
|
||||
warnEcho "pi extension dependency install failed for $ext"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue