From 1ca2e5a51231ae71826a987a166efa3f6b442d5d Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Mon, 27 Apr 2026 16:55:26 -0400 Subject: [PATCH 1/4] add pi coding agent module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .gitmodules | 3 ++ .../desktop/modules/home-manager/home.nix | 2 ++ user/modules/pi/agent | 1 + user/modules/pi/default.nix | 28 +++++++++++++++++++ 4 files changed, 34 insertions(+) create mode 160000 user/modules/pi/agent create mode 100644 user/modules/pi/default.nix diff --git a/.gitmodules b/.gitmodules index f740ede..a7bc1c6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/system/machines/desktop/modules/home-manager/home.nix b/system/machines/desktop/modules/home-manager/home.nix index 41e88bc..9eea824 100644 --- a/system/machines/desktop/modules/home-manager/home.nix +++ b/system/machines/desktop/modules/home-manager/home.nix @@ -81,6 +81,8 @@ writing.enable = true; }; + pi.enable = true; + gui = { wm.hyprland.enable = true; browser.firefox.enable = true; diff --git a/user/modules/pi/agent b/user/modules/pi/agent new file mode 160000 index 0000000..71b78ea --- /dev/null +++ b/user/modules/pi/agent @@ -0,0 +1 @@ +Subproject commit 71b78ea0c3b64e9fb253a408ad607b4f2d44f86b diff --git a/user/modules/pi/default.nix b/user/modules/pi/default.nix new file mode 100644 index 0000000..4bde7aa --- /dev/null +++ b/user/modules/pi/default.nix @@ -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) + ''; + }; +} From 9aa7b21828a27be1a10c920ea650817a73a4c427 Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Mon, 27 Apr 2026 17:22:08 -0400 Subject: [PATCH 2/4] bump pi config submodule --- user/modules/pi/agent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user/modules/pi/agent b/user/modules/pi/agent index 71b78ea..4f129c8 160000 --- a/user/modules/pi/agent +++ b/user/modules/pi/agent @@ -1 +1 @@ -Subproject commit 71b78ea0c3b64e9fb253a408ad607b4f2d44f86b +Subproject commit 4f129c83b945e8847df798f83a29e554570c6142 From a184bd35eee92d65e1496e8a3158891ef1aada78 Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Mon, 27 Apr 2026 17:26:00 -0400 Subject: [PATCH 3/4] remove opencode --- user/modules/utils/dev/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/user/modules/utils/dev/default.nix b/user/modules/utils/dev/default.nix index 991524b..c106cc2 100644 --- a/user/modules/utils/dev/default.nix +++ b/user/modules/utils/dev/default.nix @@ -9,7 +9,6 @@ in home.packages = with pkgs; [ unstable.claude-code unstable.codex - unstable.opencode bubblewrap From 42c9fbc6e135da75684bb5cd87886d5280af14bc Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Thu, 30 Apr 2026 11:01:06 -0400 Subject: [PATCH 4/4] fix(neovim): support mason tools on nixos --- system/machines/desktop/default.nix | 1 + system/machines/server/default.nix | 1 + system/machines/wsl/default.nix | 1 + system/modules/nix-ld/default.nix | 39 +++++++++++++++++++++++++++++ user/modules/neovim/nvim | 2 +- 5 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 system/modules/nix-ld/default.nix diff --git a/system/machines/desktop/default.nix b/system/machines/desktop/default.nix index 539aa63..16a68c0 100644 --- a/system/machines/desktop/default.nix +++ b/system/machines/desktop/default.nix @@ -11,6 +11,7 @@ ../../keys ../../modules/sops ../../modules/docker + ../../modules/nix-ld ./hardware.nix ./system.nix ]; diff --git a/system/machines/server/default.nix b/system/machines/server/default.nix index c7f50e0..57add69 100644 --- a/system/machines/server/default.nix +++ b/system/machines/server/default.nix @@ -10,6 +10,7 @@ ../../../user ../../keys ../../modules/sops + ../../modules/nix-ld ./hardware.nix ./system.nix ]; diff --git a/system/machines/wsl/default.nix b/system/machines/wsl/default.nix index 9fb4e88..2d2a831 100644 --- a/system/machines/wsl/default.nix +++ b/system/machines/wsl/default.nix @@ -10,6 +10,7 @@ ../../../user ../../keys ../../modules/sops + ../../modules/nix-ld ./system.nix ]; } diff --git a/system/modules/nix-ld/default.nix b/system/modules/nix-ld/default.nix new file mode 100644 index 0000000..efe4d81 --- /dev/null +++ b/system/modules/nix-ld/default.nix @@ -0,0 +1,39 @@ +{ pkgs, lib, config, ... }: + +with lib; +let + cfg = config.modules.system.nix-ld; + +in +{ + options.modules.system.nix-ld = { + enable = mkOption { + type = types.bool; + default = any + (user: user.modules.user.neovim.enable or false) + (attrValues config.home-manager.users); + description = "Enable nix-ld so Mason-installed Neovim tools can run on NixOS."; + }; + }; + + config = mkIf cfg.enable { + programs.nix-ld = { + enable = true; + libraries = with pkgs; [ + curl + expat + fontconfig + freetype + glib + icu + libgcc + libGL + libxkbcommon + openssl + stdenv.cc.cc + zlib + zstd + ]; + }; + }; +} diff --git a/user/modules/neovim/nvim b/user/modules/neovim/nvim index da6106c..f11e6a0 160000 --- a/user/modules/neovim/nvim +++ b/user/modules/neovim/nvim @@ -1 +1 @@ -Subproject commit da6106c77470b336783951ff2bce795688e9663d +Subproject commit f11e6a02db5cd8e4c8c1bdec0d34557ff995c32c