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) + ''; + }; +}