From 1ca2e5a51231ae71826a987a166efa3f6b442d5d Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Mon, 27 Apr 2026 16:55:26 -0400 Subject: [PATCH 01/18] 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 d29ec329594f383fe25f7da841f014b7c4fc05e2 Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Mon, 27 Apr 2026 16:55:26 -0400 Subject: [PATCH 02/18] 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 03/18] 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 133817cdc337dd113d3df7a3d5f851f25a4432a2 Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Mon, 27 Apr 2026 17:22:08 -0400 Subject: [PATCH 04/18] 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 05/18] 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 9f4e6c6a65b3aefcb4f197d529d19093e21706cb Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Mon, 27 Apr 2026 17:26:00 -0400 Subject: [PATCH 06/18] 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 07/18] 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 From 05d7694fa6f25edda63ee1c35f92f9b92563366a Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Thu, 30 Apr 2026 13:16:27 -0400 Subject: [PATCH 08/18] fix(neovim): let mason own lsp tools --- user/modules/neovim/nvim | 2 +- user/modules/neovim/pkgs.nix | 26 ++++---------------------- 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/user/modules/neovim/nvim b/user/modules/neovim/nvim index f11e6a0..b1d9a8e 160000 --- a/user/modules/neovim/nvim +++ b/user/modules/neovim/nvim @@ -1 +1 @@ -Subproject commit f11e6a02db5cd8e4c8c1bdec0d34557ff995c32c +Subproject commit b1d9a8eae801a0340e506d7197615a77e9f0571e diff --git a/user/modules/neovim/pkgs.nix b/user/modules/neovim/pkgs.nix index 04dcd86..1bdeb8a 100644 --- a/user/modules/neovim/pkgs.nix +++ b/user/modules/neovim/pkgs.nix @@ -1,24 +1,6 @@ { pkgs, ... }: -let - # Essential LSPs for config files (project-specific LSPs go in devShells) - lsp = with pkgs; [ - nixd - lua-language-server - marksman - taplo - ]; - - lsp' = with pkgs.nodePackages; [ - vscode-langservers-extracted # jsonls, html, cssls - bash-language-server - yaml-language-server - ]; - - extraPackages = with pkgs; [ - lazygit - gcc - ]; - -in - extraPackages ++ lsp ++ lsp' +with pkgs; [ + gcc + lazygit +] From 45a648642bb8f3f7c52f505723b77dbb30a7e5e8 Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Thu, 30 Apr 2026 13:36:39 -0400 Subject: [PATCH 09/18] fix(neovim): point submodule at upstream commit --- user/modules/neovim/nvim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user/modules/neovim/nvim b/user/modules/neovim/nvim index b1d9a8e..17bf7e4 160000 --- a/user/modules/neovim/nvim +++ b/user/modules/neovim/nvim @@ -1 +1 @@ -Subproject commit b1d9a8eae801a0340e506d7197615a77e9f0571e +Subproject commit 17bf7e4973d079fd54355563a8d99c5ab023bd20 From 9235442782f1ab85c23d3c1dfea95b2f3af70f1c Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Thu, 30 Apr 2026 16:45:40 -0400 Subject: [PATCH 10/18] updated submodules --- user/modules/bash/bash | 2 +- user/modules/neovim/nvim | 2 +- user/modules/pi/agent | 2 +- user/modules/vim/vim | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/user/modules/bash/bash b/user/modules/bash/bash index 6667f36..f0fe41e 160000 --- a/user/modules/bash/bash +++ b/user/modules/bash/bash @@ -1 +1 @@ -Subproject commit 6667f36a9f83a88b33b691a5a9b701365267bbb3 +Subproject commit f0fe41e942dfedab23828131372a5545a6d5c4c6 diff --git a/user/modules/neovim/nvim b/user/modules/neovim/nvim index 17bf7e4..7d72471 160000 --- a/user/modules/neovim/nvim +++ b/user/modules/neovim/nvim @@ -1 +1 @@ -Subproject commit 17bf7e4973d079fd54355563a8d99c5ab023bd20 +Subproject commit 7d72471237b131527015afbc41f3a6ce96a33842 diff --git a/user/modules/pi/agent b/user/modules/pi/agent index 4f129c8..b0524fd 160000 --- a/user/modules/pi/agent +++ b/user/modules/pi/agent @@ -1 +1 @@ -Subproject commit 4f129c83b945e8847df798f83a29e554570c6142 +Subproject commit b0524fdd3056c7dd951b41f7da410dde37f91a67 diff --git a/user/modules/vim/vim b/user/modules/vim/vim index 8c8a4e4..d5bdb39 160000 --- a/user/modules/vim/vim +++ b/user/modules/vim/vim @@ -1 +1 @@ -Subproject commit 8c8a4e4a7afd175be2eb97055bb01f43ee8b992d +Subproject commit d5bdb39d7e65e679b3052e5ec437f75e4ec8e594 From eda6d62b95d08abef32cd6e08ead1715649c2f33 Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Thu, 30 Apr 2026 17:00:03 -0400 Subject: [PATCH 11/18] fixed fzf.nvim retarded tab default --- user/modules/neovim/nvim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user/modules/neovim/nvim b/user/modules/neovim/nvim index 7d72471..79643b1 160000 --- a/user/modules/neovim/nvim +++ b/user/modules/neovim/nvim @@ -1 +1 @@ -Subproject commit 7d72471237b131527015afbc41f3a6ce96a33842 +Subproject commit 79643b1a17336b43f09090aa51ffc18763e11552 From 1012029022b3fe11f47dcde11be0bf77e20caa0b Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Thu, 30 Apr 2026 21:43:28 -0400 Subject: [PATCH 12/18] updated --- flake.lock | 6 +++--- user/modules/bash/bash | 2 +- user/modules/gui/utils/default.nix | 1 + user/modules/neovim/nvim | 2 +- user/modules/pi/agent | 2 +- user/modules/pi/default.nix | 10 ++++++++++ user/modules/vim/vim | 2 +- 7 files changed, 18 insertions(+), 7 deletions(-) diff --git a/flake.lock b/flake.lock index aa265c3..2eb1556 100644 --- a/flake.lock +++ b/flake.lock @@ -118,11 +118,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1776169885, - "narHash": "sha256-l/iNYDZ4bGOAFQY2q8y5OAfBBtrDAaPuRQqWaFHVRXM=", + "lastModified": 1776548001, + "narHash": "sha256-ZSK0NL4a1BwVbbTBoSnWgbJy9HeZFXLYQizjb2DPF24=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4bd9165a9165d7b5e33ae57f3eecbcb28fb231c9", + "rev": "b12141ef619e0a9c1c84dc8c684040326f27cdcc", "type": "github" }, "original": { diff --git a/user/modules/bash/bash b/user/modules/bash/bash index 6667f36..f0fe41e 160000 --- a/user/modules/bash/bash +++ b/user/modules/bash/bash @@ -1 +1 @@ -Subproject commit 6667f36a9f83a88b33b691a5a9b701365267bbb3 +Subproject commit f0fe41e942dfedab23828131372a5545a6d5c4c6 diff --git a/user/modules/gui/utils/default.nix b/user/modules/gui/utils/default.nix index f162ad3..626a269 100644 --- a/user/modules/gui/utils/default.nix +++ b/user/modules/gui/utils/default.nix @@ -11,6 +11,7 @@ in home.packages = with pkgs; [ gimp libreoffice + signal-desktop ]; }; } diff --git a/user/modules/neovim/nvim b/user/modules/neovim/nvim index da6106c..79643b1 160000 --- a/user/modules/neovim/nvim +++ b/user/modules/neovim/nvim @@ -1 +1 @@ -Subproject commit da6106c77470b336783951ff2bce795688e9663d +Subproject commit 79643b1a17336b43f09090aa51ffc18763e11552 diff --git a/user/modules/pi/agent b/user/modules/pi/agent index 4f129c8..b0524fd 160000 --- a/user/modules/pi/agent +++ b/user/modules/pi/agent @@ -1 +1 @@ -Subproject commit 4f129c83b945e8847df798f83a29e554570c6142 +Subproject commit b0524fdd3056c7dd951b41f7da410dde37f91a67 diff --git a/user/modules/pi/default.nix b/user/modules/pi/default.nix index 4bde7aa..d9ab77d 100644 --- a/user/modules/pi/default.nix +++ b/user/modules/pi/default.nix @@ -4,6 +4,8 @@ with lib; let cfg = config.modules.user.pi; npmGlobal = "${config.home.homeDirectory}/.npm-global"; + piVersion = "0.70.5"; + in { options.modules.user.pi = { enable = mkEnableOption "user.pi"; }; config = mkIf cfg.enable { @@ -24,5 +26,13 @@ in 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" + run mkdir -p ${npmGlobal} + 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 + ''; }; } diff --git a/user/modules/vim/vim b/user/modules/vim/vim index 8c8a4e4..d5bdb39 160000 --- a/user/modules/vim/vim +++ b/user/modules/vim/vim @@ -1 +1 @@ -Subproject commit 8c8a4e4a7afd175be2eb97055bb01f43ee8b992d +Subproject commit d5bdb39d7e65e679b3052e5ec437f75e4ec8e594 From 25d2c27935551a3bf2de161506f275531843f02e Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Thu, 30 Apr 2026 22:02:20 -0400 Subject: [PATCH 13/18] chore(nvim) bump submodule --- user/modules/neovim/nvim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user/modules/neovim/nvim b/user/modules/neovim/nvim index 79643b1..22675bf 160000 --- a/user/modules/neovim/nvim +++ b/user/modules/neovim/nvim @@ -1 +1 @@ -Subproject commit 79643b1a17336b43f09090aa51ffc18763e11552 +Subproject commit 22675bf8a44bcc9f166a850f4827374a538dfab3 From 52ba79c38dec8b2652b1d2ba43c4df1f4fc09d6e Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Thu, 30 Apr 2026 22:07:51 -0400 Subject: [PATCH 14/18] fixed nix-ld --- system/machines/desktop/system.nix | 2 ++ user/modules/neovim/default.nix | 7 ++++++- user/modules/neovim/pkgs.nix | 24 ------------------------ 3 files changed, 8 insertions(+), 25 deletions(-) delete mode 100644 user/modules/neovim/pkgs.nix diff --git a/system/machines/desktop/system.nix b/system/machines/desktop/system.nix index e981ab8..7b6a061 100644 --- a/system/machines/desktop/system.nix +++ b/system/machines/desktop/system.nix @@ -66,6 +66,8 @@ in }; }; + programs.nix-ld.enable = true; + boot.loader = { systemd-boot = { enable = true; diff --git a/user/modules/neovim/default.nix b/user/modules/neovim/default.nix index 9a90d08..361bf65 100644 --- a/user/modules/neovim/default.nix +++ b/user/modules/neovim/default.nix @@ -12,7 +12,12 @@ in defaultEditor = true; vimAlias = true; vimdiffAlias = true; - extraPackages = import ./pkgs.nix { inherit pkgs; }; + extraPackages = with pkgs; [ + lazygit + gcc + fzf + rg + ]; }; home.file.".config/nvim" = { diff --git a/user/modules/neovim/pkgs.nix b/user/modules/neovim/pkgs.nix deleted file mode 100644 index 04dcd86..0000000 --- a/user/modules/neovim/pkgs.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ pkgs, ... }: - -let - # Essential LSPs for config files (project-specific LSPs go in devShells) - lsp = with pkgs; [ - nixd - lua-language-server - marksman - taplo - ]; - - lsp' = with pkgs.nodePackages; [ - vscode-langservers-extracted # jsonls, html, cssls - bash-language-server - yaml-language-server - ]; - - extraPackages = with pkgs; [ - lazygit - gcc - ]; - -in - extraPackages ++ lsp ++ lsp' From 9a9aa63564025fcc8b29544e82183301b826da59 Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Thu, 30 Apr 2026 22:35:09 -0400 Subject: [PATCH 15/18] big updates --- system/machines/desktop/system.nix | 7 +++- user/modules/git/default.nix | 4 +-- .../gui/alacritty/config/alacritty.nix | 34 +++++++++---------- user/modules/neovim/default.nix | 4 ++- user/modules/neovim/nvim | 2 +- 5 files changed, 28 insertions(+), 23 deletions(-) diff --git a/system/machines/desktop/system.nix b/system/machines/desktop/system.nix index 7b6a061..080e157 100644 --- a/system/machines/desktop/system.nix +++ b/system/machines/desktop/system.nix @@ -66,7 +66,12 @@ in }; }; - programs.nix-ld.enable = true; + programs.nix-ld = { + enable = true; + libraries = with pkgs; [ + icu + ]; + }; boot.loader = { systemd-boot = { diff --git a/user/modules/git/default.nix b/user/modules/git/default.nix index 26baea5..8d95730 100644 --- a/user/modules/git/default.nix +++ b/user/modules/git/default.nix @@ -8,9 +8,6 @@ in { options.modules.user.git = { enable = mkEnableOption "user.git"; }; config = mkIf cfg.enable { programs = { - git = { - enable = true; - }; gh = { enable = true; settings.git_protocol = "ssh"; @@ -19,6 +16,7 @@ in home = { packages = with pkgs; [ + git git-crypt ]; file.".config/git" = { diff --git a/user/modules/gui/alacritty/config/alacritty.nix b/user/modules/gui/alacritty/config/alacritty.nix index b396d7c..4df8cff 100644 --- a/user/modules/gui/alacritty/config/alacritty.nix +++ b/user/modules/gui/alacritty/config/alacritty.nix @@ -25,29 +25,29 @@ in colors = { primary = { background = "#000000"; - foreground = "#cdd6f4"; + foreground = "#dadada"; }; normal = { - black = "#1e2127"; - red = "#e06c75"; - green = "#98c379"; - yellow = "#d19a66"; - blue = "#61afef"; - magenta = "#c678dd"; - cyan = "#56b6c2"; - white = "#abb2bf"; + black = "#181818"; + red = "#ff6b6b"; + green = "#00b300"; + yellow = "#e8a060"; + blue = "#88ddcc"; + magenta = "#c490d0"; + cyan = "#b3f6c0"; + white = "#dadada"; }; bright = { - black = "#5c6370"; - red = "#e06c75"; - green = "#98c379"; - yellow = "#d19a66"; - blue = "#61afef"; - magenta = "#c678dd"; - cyan = "#56b6c2"; - white = "#ffffff"; + black = "#5a5a5a"; + red = "#ff6b6b"; + green = "#00b300"; + yellow = "#ffcc00"; + blue = "#88ddcc"; + magenta = "#c490d0"; + cyan = "#b3f6c0"; + white = "#ffffff"; }; }; diff --git a/user/modules/neovim/default.nix b/user/modules/neovim/default.nix index 361bf65..3f5b8cf 100644 --- a/user/modules/neovim/default.nix +++ b/user/modules/neovim/default.nix @@ -14,9 +14,11 @@ in vimdiffAlias = true; extraPackages = with pkgs; [ lazygit + cargo + rustc gcc fzf - rg + ripgrep ]; }; diff --git a/user/modules/neovim/nvim b/user/modules/neovim/nvim index 22675bf..14a67ba 160000 --- a/user/modules/neovim/nvim +++ b/user/modules/neovim/nvim @@ -1 +1 @@ -Subproject commit 22675bf8a44bcc9f166a850f4827374a538dfab3 +Subproject commit 14a67ba7d3210d915e26588da9d0326e8118d353 From 0125273b5726a092e828541d0d4deb0739bdc102 Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Thu, 30 Apr 2026 22:43:48 -0400 Subject: [PATCH 16/18] chore(git): bump submodule --- user/modules/git/git | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user/modules/git/git b/user/modules/git/git index 8b16b70..7ea8c16 160000 --- a/user/modules/git/git +++ b/user/modules/git/git @@ -1 +1 @@ -Subproject commit 8b16b7047c3fa70945cca5a058408b57b2ef2e7f +Subproject commit 7ea8c164bc6ab3eaea2ff5743cfa2db62fd62397 From 9feb01d2d6bc7dd0b4407e734a14d7ad85308332 Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Thu, 30 Apr 2026 22:58:18 -0400 Subject: [PATCH 17/18] updated --- user/modules/neovim/default.nix | 6 ++++-- user/modules/pi/default.nix | 28 +++++++++++++++++++++++----- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/user/modules/neovim/default.nix b/user/modules/neovim/default.nix index 3f5b8cf..838065d 100644 --- a/user/modules/neovim/default.nix +++ b/user/modules/neovim/default.nix @@ -13,12 +13,14 @@ in vimAlias = true; vimdiffAlias = true; extraPackages = with pkgs; [ - lazygit + gcc cargo rustc - gcc + fzf + fd ripgrep + bat ]; }; diff --git a/user/modules/pi/default.nix b/user/modules/pi/default.nix index d9ab77d..7452bb4 100644 --- a/user/modules/pi/default.nix +++ b/user/modules/pi/default.nix @@ -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 ''; }; } From 5287411131920ecd08d231cc2261d822e4b25401 Mon Sep 17 00:00:00 2001 From: Bryan Ramos Date: Thu, 30 Apr 2026 23:26:45 -0400 Subject: [PATCH 18/18] changes --- flake.lock | 42 ++++++++++++++++----------------- user/modules/bash/default.nix | 2 +- user/modules/git/default.nix | 2 +- user/modules/neovim/default.nix | 8 ++++++- user/modules/neovim/nvim | 2 +- user/modules/pi/default.nix | 26 ++++++++++++++++++++ user/modules/vim/default.nix | 2 +- 7 files changed, 58 insertions(+), 26 deletions(-) diff --git a/flake.lock b/flake.lock index 2eb1556..a2673aa 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1773025010, - "narHash": "sha256-khlHllTsovXgT2GZ0WxT4+RvuMjNeR5OW0UYeEHPYQo=", + "lastModified": 1776613567, + "narHash": "sha256-gC9Cp5ibBmGD5awCA9z7xy6MW6iJufhazTYJOiGlCUI=", "owner": "nix-community", "repo": "disko", - "rev": "7b9f7f88ab3b339f8142dc246445abb3c370d3d3", + "rev": "32f4236bfc141ae930b5ba2fb604f561fed5219d", "type": "github" }, "original": { @@ -64,11 +64,11 @@ ] }, "locked": { - "lastModified": 1772985280, - "narHash": "sha256-FdrNykOoY9VStevU4zjSUdvsL9SzJTcXt4omdEDZDLk=", + "lastModified": 1775425411, + "narHash": "sha256-KY6HsebJHEe5nHOWP7ur09mb0drGxYSzE3rQxy62rJo=", "owner": "nix-community", "repo": "home-manager", - "rev": "8f736f007139d7f70752657dff6a401a585d6cbc", + "rev": "0d02ec1d0a05f88ef9e74b516842900c41f0f2fe", "type": "github" }, "original": { @@ -102,11 +102,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1773375660, - "narHash": "sha256-SEzUWw2Rf5Ki3bcM26nSKgbeoqi2uYy8IHVBqOKjX3w=", + "lastModified": 1777428379, + "narHash": "sha256-ypxFOeDz+CqADEQNL72haqGjvZQdBR5Vc7pyx2JDttI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3e20095fe3c6cbb1ddcef89b26969a69a1570776", + "rev": "755f5aa91337890c432639c60b6064bb7fe67769", "type": "github" }, "original": { @@ -118,11 +118,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1776548001, - "narHash": "sha256-ZSK0NL4a1BwVbbTBoSnWgbJy9HeZFXLYQizjb2DPF24=", + "lastModified": 1777268161, + "narHash": "sha256-bxrdOn8SCOv8tN4JbTF/TXq7kjo9ag4M+C8yzzIRYbE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b12141ef619e0a9c1c84dc8c684040326f27cdcc", + "rev": "1c3fe55ad329cbcb28471bb30f05c9827f724c76", "type": "github" }, "original": { @@ -134,11 +134,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1772963539, - "narHash": "sha256-9jVDGZnvCckTGdYT53d/EfznygLskyLQXYwJLKMPsZs=", + "lastModified": 1777268161, + "narHash": "sha256-bxrdOn8SCOv8tN4JbTF/TXq7kjo9ag4M+C8yzzIRYbE=", "owner": "nixos", "repo": "nixpkgs", - "rev": "9dcb002ca1690658be4a04645215baea8b95f31d", + "rev": "1c3fe55ad329cbcb28471bb30f05c9827f724c76", "type": "github" }, "original": { @@ -154,11 +154,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1773108757, - "narHash": "sha256-3BAoe2R6YA6Xjdsgx3urZ4Ns3LeTy0E/w5d1wPny910=", + "lastModified": 1777603930, + "narHash": "sha256-IkawcGZuNSlf7mkiGo6NgmZir248sd6mVvUj1kuPIMw=", "owner": "nix-community", "repo": "NUR", - "rev": "9f2c583704f122828e6f9893416ca3b007464ee6", + "rev": "e7e4dc38580b7ef29d36d4afd3ba808e4f7ef5d5", "type": "github" }, "original": { @@ -185,11 +185,11 @@ ] }, "locked": { - "lastModified": 1773550941, - "narHash": "sha256-wa/++bL2QeMUreNFBZEWluQfOYB0MnQIeGNMuaX9sfs=", + "lastModified": 1777338324, + "narHash": "sha256-bc+ZZCmOTNq86/svGnw0tVpH7vJaLYvGLLKFYP08Q8E=", "owner": "Mic92", "repo": "sops-nix", - "rev": "c469b6885f0dcd5c7c56bd935a0f08dbcd9e79e1", + "rev": "8eaee5c45428b28b8c47a83e4c09dccec5f279b5", "type": "github" }, "original": { diff --git a/user/modules/bash/default.nix b/user/modules/bash/default.nix index a1420a7..631890b 100644 --- a/user/modules/bash/default.nix +++ b/user/modules/bash/default.nix @@ -13,7 +13,7 @@ in }; home.file.".config/bash" = { - source = ./bash; + source = config.lib.file.mkOutOfStoreSymlink ./bash; recursive = true; }; diff --git a/user/modules/git/default.nix b/user/modules/git/default.nix index 8d95730..aa2ff58 100644 --- a/user/modules/git/default.nix +++ b/user/modules/git/default.nix @@ -20,7 +20,7 @@ in git-crypt ]; file.".config/git" = { - source = ./git; + source = config.lib.file.mkOutOfStoreSymlink ./git; recursive = true; }; }; diff --git a/user/modules/neovim/default.nix b/user/modules/neovim/default.nix index 838065d..2c81e51 100644 --- a/user/modules/neovim/default.nix +++ b/user/modules/neovim/default.nix @@ -12,6 +12,12 @@ in defaultEditor = true; vimAlias = true; vimdiffAlias = true; + extraWrapperArgs = [ + "--suffix" + "PATH" + ":" + "${config.home.homeDirectory}/.npm-global/bin" + ]; extraPackages = with pkgs; [ gcc cargo @@ -25,7 +31,7 @@ in }; home.file.".config/nvim" = { - source = ./nvim; + source = config.lib.file.mkOutOfStoreSymlink ./nvim; recursive = true; }; }; diff --git a/user/modules/neovim/nvim b/user/modules/neovim/nvim index 14a67ba..376b9c5 160000 --- a/user/modules/neovim/nvim +++ b/user/modules/neovim/nvim @@ -1 +1 @@ -Subproject commit 14a67ba7d3210d915e26588da9d0326e8118d353 +Subproject commit 376b9c5c16b9d8b121b73516219082e57b397bc9 diff --git a/user/modules/pi/default.nix b/user/modules/pi/default.nix index 7452bb4..aa3bf51 100644 --- a/user/modules/pi/default.nix +++ b/user/modules/pi/default.nix @@ -25,7 +25,12 @@ in home.activation.installPiCodingAgent = lib.hm.dag.entryAfter [ "writeBoundary" ] '' PATH="${pkgs.nodejs_20}/bin:$PATH" agentDir="${config.home.homeDirectory}/.pi/agent" + piPkgScope="${npmGlobal}/lib/node_modules/@mariozechner" + piPkgDir="${npmGlobal}/lib/node_modules/@mariozechner/pi-coding-agent" + piBin="${npmGlobal}/bin/pi" run mkdir -p ${npmGlobal} + run mkdir -p "${npmGlobal}/bin" + run mkdir -p "$piPkgScope" run mkdir -p "${config.home.homeDirectory}/.pi" run mkdir -p "$agentDir" if [ -e "$agentDir" ]; then @@ -34,10 +39,31 @@ in fi run cp -R ${./agent}/. "$agentDir"/ run chmod -R u+w "$agentDir" + run rm -f "$piBin" + run rm -f "${npmGlobal}/bin"/.pi-* + run rm -rf "$piPkgDir" + run rm -rf "$piPkgScope"/.pi-coding-agent-* 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 + if [ ! -f "$piPkgDir/package.json" ]; then + for candidate in "$piPkgScope"/.pi-coding-agent-*; do + if [ -f "$candidate/package.json" ]; then + run rm -rf "$piPkgDir" + run mv "$candidate" "$piPkgDir" + break + fi + done + fi + + if [ -f "$piPkgDir/dist/cli.js" ]; then + run ln -sfn ../lib/node_modules/@mariozechner/pi-coding-agent/dist/cli.js "$piBin" + run chmod +x "$piPkgDir/dist/cli.js" + else + warnEcho "pi-coding-agent install did not produce dist/cli.js" + fi + for ext in "$agentDir"/extensions/*; do if [ -f "$ext/package.json" ]; then if [ -f "$ext/package-lock.json" ]; then diff --git a/user/modules/vim/default.nix b/user/modules/vim/default.nix index 68aed8a..05a1ce4 100644 --- a/user/modules/vim/default.nix +++ b/user/modules/vim/default.nix @@ -16,7 +16,7 @@ in vim ]; file.".vim" = { - source = ./vim; + source = config.lib.file.mkOutOfStoreSymlink ./vim; recursive = true; }; };