mirror of
https://github.com/itme-brain/nixos.git
synced 2026-05-08 06:50:11 -04:00
add pi coding agent module
Manages `~/.pi/agent` config via the itme-brain/pi submodule and provides nodejs_20 with NPM_CONFIG_PREFIX=~/.npm-global so pi and its extensions install via the global npm ecosystem. Pi itself and extensions like pi-mcp-adapter are installed manually via `npm install -g` rather than packaged through nix — the ecosystem moves too fast to keep derivations current.
This commit is contained in:
parent
46833d374e
commit
d29ec32959
4 changed files with 34 additions and 0 deletions
3
.gitmodules
vendored
3
.gitmodules
vendored
|
|
@ -14,3 +14,6 @@
|
|||
path = user/modules/bash/bash
|
||||
url = https://github.com/itme-brain/bash.git
|
||||
branch = master
|
||||
[submodule "user/modules/pi/agent"]
|
||||
path = user/modules/pi/agent
|
||||
url = git@github.com:itme-brain/pi.git
|
||||
|
|
|
|||
|
|
@ -81,6 +81,8 @@
|
|||
writing.enable = true;
|
||||
};
|
||||
|
||||
pi.enable = true;
|
||||
|
||||
gui = {
|
||||
wm.hyprland.enable = true;
|
||||
browser.firefox.enable = true;
|
||||
|
|
|
|||
1
user/modules/pi/agent
Submodule
1
user/modules/pi/agent
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 71b78ea0c3b64e9fb253a408ad607b4f2d44f86b
|
||||
28
user/modules/pi/default.nix
Normal file
28
user/modules/pi/default.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.user.pi;
|
||||
npmGlobal = "${config.home.homeDirectory}/.npm-global";
|
||||
in
|
||||
{ options.modules.user.pi = { enable = mkEnableOption "user.pi"; };
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = with pkgs; [ nodejs_20 ];
|
||||
|
||||
home.sessionVariables = {
|
||||
LLAMACPP_BASE_URL = "https://ai.ramos.codes/v1";
|
||||
NPM_CONFIG_PREFIX = npmGlobal;
|
||||
};
|
||||
|
||||
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)
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue