things
This commit is contained in:
+102
-44
@@ -7,66 +7,101 @@
|
||||
{
|
||||
modules.pi-coding = {
|
||||
homeManager =
|
||||
{ pkgs, ... }:
|
||||
{ pkgs, config, ... }:
|
||||
{
|
||||
sops = {
|
||||
secrets.scug-io-ai-key = {
|
||||
# sopsFile = ./secrets.yaml;
|
||||
# Decrypted file path (available at runtime, not eval time)
|
||||
path = config.home.homeDirectory + "/.secrets/scug_io_api_key";
|
||||
sopsFile = ../secrets/content/secrets.yaml;
|
||||
};
|
||||
secrets.opencode-go-zen-key = {
|
||||
# sopsFile = ./secrets.yaml;
|
||||
# Decrypted file path (available at runtime, not eval time)
|
||||
path = config.home.homeDirectory + "/.secrets/opencode-go-zen-key";
|
||||
sopsFile = ../secrets/content/secrets.yaml;
|
||||
};
|
||||
};
|
||||
programs.fish = {
|
||||
shellInit = ''
|
||||
if test -f "$HOME/.secrets/scug_io_api_key"
|
||||
set -x SCUG_IO_API_KEY (cat "$HOME/.secrets/scug_io_api_key")
|
||||
end
|
||||
if test -f "$HOME/.secrets/opencode-go-zen-key"
|
||||
set -x OPENCODE_GO_API_KEY (cat "$HOME/.secrets/opencode-go-zen-key")
|
||||
end
|
||||
set -x PI_LENS_STARTUP_MODE quick
|
||||
'';
|
||||
};
|
||||
programs.pi-coding-agent = {
|
||||
enable = true;
|
||||
extraPackages = [
|
||||
pkgs.nodejs
|
||||
# pkgs.lean-lsp-mcp
|
||||
];
|
||||
package = pkgs.pi-coding-agent.overrideAttrs (
|
||||
new: old: {
|
||||
version = "0.81.1";
|
||||
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "earendil-works";
|
||||
repo = "pi";
|
||||
tag = "v${new.version}";
|
||||
hash = "sha256-xo3uoR7HceOCL3wqoMcacOe8WXP1o7ReAXne5t6Hgao=";
|
||||
};
|
||||
|
||||
npmDepsHash = "sha256-lzKQZbnITzgV9koucsMno6f61ubBLYUcwQEXtak1r1s=";
|
||||
# npmDepsHash = pkgs.lib.fakeHash;
|
||||
|
||||
# npmDepsHash = "sha256-lDoj/94tjJd4ZGU9WgrMOqNSmdpeCljU4c6jGX+TSDY=";
|
||||
|
||||
npmDeps = pkgs.fetchNpmDeps {
|
||||
inherit (new) src;
|
||||
name = "pi-coding-agent-0.81.1-npm-deps";
|
||||
hash = new.npmDepsHash;
|
||||
};
|
||||
modelData = pkgs.fetchurl {
|
||||
url = "https://registry.npmjs.org/@earendil-works/pi-ai/-/pi-ai-${new.version}.tgz";
|
||||
hash = "sha256-x53MD5DU370ZdNoz36P+OWZjGVpoM5sfVcEU2/ckDy8=";
|
||||
# hash = pkgs.lib.fakeHash;
|
||||
};
|
||||
preConfigure = ''
|
||||
mkdir -p packages/ai/src/providers/data
|
||||
tar --extract --gzip --file=${new.modelData} \
|
||||
--directory=packages/ai/src/providers/data \
|
||||
--strip-components=4 \
|
||||
package/dist/providers/data
|
||||
'';
|
||||
passthru.updateScript = pkgs.nix-update-script {
|
||||
extraArgs = [
|
||||
"--custom-dep"
|
||||
"modelData"
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
# package = pkgs.pi-coding-agent.overrideAttrs (
|
||||
# new: old: {
|
||||
# version = "0.81.1";
|
||||
#
|
||||
# src = pkgs.fetchFromGitHub {
|
||||
# owner = "earendil-works";
|
||||
# repo = "pi";
|
||||
# tag = "v${new.version}";
|
||||
# hash = "sha256-xo3uoR7HceOCL3wqoMcacOe8WXP1o7ReAXne5t6Hgao=";
|
||||
# };
|
||||
#
|
||||
# npmDepsHash = "sha256-lzKQZbnITzgV9koucsMno6f61ubBLYUcwQEXtak1r1s=";
|
||||
# # npmDepsHash = pkgs.lib.fakeHash;
|
||||
#
|
||||
# # npmDepsHash = "sha256-lDoj/94tjJd4ZGU9WgrMOqNSmdpeCljU4c6jGX+TSDY=";
|
||||
#
|
||||
# npmDeps = pkgs.fetchNpmDeps {
|
||||
# inherit (new) src;
|
||||
# name = "pi-coding-agent-0.81.1-npm-deps";
|
||||
# hash = new.npmDepsHash;
|
||||
# };
|
||||
# modelData = pkgs.fetchurl {
|
||||
# url = "https://registry.npmjs.org/@earendil-works/pi-ai/-/pi-ai-${new.version}.tgz";
|
||||
# hash = "sha256-x53MD5DU370ZdNoz36P+OWZjGVpoM5sfVcEU2/ckDy8=";
|
||||
# # hash = pkgs.lib.fakeHash;
|
||||
# };
|
||||
# preConfigure = ''
|
||||
# mkdir -p packages/ai/src/providers/data
|
||||
# tar --extract --gzip --file=${new.modelData} \
|
||||
# --directory=packages/ai/src/providers/data \
|
||||
# --strip-components=4 \
|
||||
# package/dist/providers/data
|
||||
# '';
|
||||
# passthru.updateScript = pkgs.nix-update-script {
|
||||
# extraArgs = [
|
||||
# "--custom-dep"
|
||||
# "modelData"
|
||||
# ];
|
||||
# };
|
||||
# }
|
||||
# );
|
||||
settings = {
|
||||
"openrouter" = {
|
||||
"compat" = {
|
||||
"sendSessionAffinityHeaders" = true;
|
||||
};
|
||||
};
|
||||
"providers" = {
|
||||
"opencode-go" = {
|
||||
# "type" = "api_key";
|
||||
# "apiKey" = "$OPENCODE_GO_API_KEY";
|
||||
"compat" = {
|
||||
"supportsLongCacheRetention" = true;
|
||||
"sendSessionAffinityHeaders" = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
"litellm" = {
|
||||
"providers" = {
|
||||
"litellm" = {
|
||||
"displayName" = "scuggo";
|
||||
"baseUrl" = "https://9f5db439.fwds.scug.io";
|
||||
"baseUrl" = "https://ai-proxy.fwds.scug.io";
|
||||
"apiKey" = "$SCUG_IO_API_KEY";
|
||||
"compat" = {
|
||||
"sendSessionAffinityHeaders" = true;
|
||||
@@ -83,6 +118,7 @@
|
||||
"mcp" = {
|
||||
"enabled" = true;
|
||||
};
|
||||
"uiMode" = "fullscreen";
|
||||
"showCacheMissNotices" = true;
|
||||
"vstack" = {
|
||||
"extensionManager" = {
|
||||
@@ -110,7 +146,7 @@
|
||||
# "npm:pi-web-access"
|
||||
# "npm:@gotgenes/pi-permission-system"
|
||||
"npm:@vanillagreen/pi-extension-manager"
|
||||
"npm:@vanillagreen/pi-qol"
|
||||
# "npm:@vanillagreen/pi-qol"
|
||||
"npm:pi-vitals"
|
||||
"npm:pi-spark"
|
||||
"npm:@zhushanwen/pi-context-engineering"
|
||||
@@ -251,6 +287,28 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
home.file.".pi/agent/auth.json" = {
|
||||
text = builtins.toJSON {
|
||||
"opencode-go" = {
|
||||
"type" = "api_key";
|
||||
"key" = "$OPENCODE_GO_API_KEY";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Cache/routing compat overrides (provider-level minimal)
|
||||
home.file.".pi/agent/models.json" = {
|
||||
text = builtins.toJSON {
|
||||
providers = {
|
||||
"opencode-go" = {
|
||||
compat = {
|
||||
supportsLongCacheRetention = true;
|
||||
# sendSessionAffinityHeaders = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# pi-spark config
|
||||
home.file.".pi/agent/spark.json" = {
|
||||
|
||||
Reference in New Issue
Block a user