refactor/remove-pi-agent-cleanup #14

Merged
m3tam3re merged 13 commits from refactor/remove-pi-agent-cleanup into master 2026-04-19 18:16:50 +02:00
7 changed files with 71 additions and 22 deletions
Showing only changes of commit 44c7e0d19a - Show all commits

2
.gitignore vendored
View File

@@ -43,3 +43,5 @@ flake.lock.bak
.sidecar-start.sh .sidecar-start.sh
.sidecar-base .sidecar-base
.td-root .td-root
.pi-lens
.cache

View File

@@ -36,9 +36,50 @@ in {
''; '';
}; };
externalSkills = mkOption {
type = types.listOf (types.submodule {
options = {
src = mkOption {
type = types.anything;
description = "Flake input pointing to a skills repository root.";
};
skillsDir = mkOption {
type = types.str;
default = "skills";
description = ''
Subdirectory inside src that contains skill folders.
'';
};
selectSkills = mkOption {
type = types.nullOr (types.listOf types.str);
default = null;
description = ''
List of skill names to cherry-pick from this source.
null means include every skill found in skillsDir.
'';
};
};
});
default = [];
description = ''
External skill sources passed to mkOpencodeSkills.
Each entry maps directly to an element of the externalSkills
list accepted by the AGENTS flake's lib.mkOpencodeSkills.
'';
example = literalExpression ''
[
{ src = inputs.skills-anthropic; selectSkills = [ "claude-api" ]; }
{ src = inputs.skills-vercel; }
]
'';
};
mcpServers = mkOption { mcpServers = mkOption {
type = types.attrsOf types.anything; type = types.attrsOf types.anything;
default = if mcpCfg != null then mcpCfg.servers else {}; default =
if mcpCfg != null
then mcpCfg.servers
else {};
defaultText = literalExpression "config.programs.mcp.servers"; defaultText = literalExpression "config.programs.mcp.servers";
description = '' description = ''
MCP server configurations for Claude Code. MCP server configurations for Claude Code.
@@ -82,6 +123,21 @@ in {
source = "${rendered}/.claude/agents"; source = "${rendered}/.claude/agents";
}; };
# Skills (merged from personal AGENTS repo + optional external skills)
home.file.".claude/skills" = mkIf (cfg.agentsInput != null) {
source = cfg.agentsInput.lib.mkOpencodeSkills {
inherit pkgs;
customSkills = "${cfg.agentsInput}/skills";
externalSkills =
map (
entry:
{inherit (entry) src skillsDir;}
// optionalAttrs (entry.selectSkills != null) {inherit (entry) selectSkills;}
)
cfg.externalSkills;
};
};
# Rendered settings.json with permissions + MCP servers # Rendered settings.json with permissions + MCP servers
home.file.".claude/settings.json" = mkIf (settingsJson != null) { home.file.".claude/settings.json" = mkIf (settingsJson != null) {
source = "${settingsJson}"; source = "${settingsJson}";

View File

@@ -1,7 +1,6 @@
{inputs, ...}: { {inputs, ...}: {
# This one brings our custom packages from the 'pkgs' directory # This one brings our custom packages from the 'pkgs' directory
additions = final: prev: additions = final: prev: (import ../pkgs {pkgs = final;});
(import ../pkgs {pkgs = final;});
# This one contains whatever you want to overlay # This one contains whatever you want to overlay
# You can change versions, add patches, set compilation flags, anything really. # You can change versions, add patches, set compilation flags, anything really.

View File

@@ -8,10 +8,10 @@
nix-update-script, nix-update-script,
}: let }: let
pname = "eigent"; pname = "eigent";
version = "0.0.89"; version = "0.0.90";
src = fetchurl { src = fetchurl {
url = "https://github.com/eigent-ai/eigent/releases/download/v${version}/Eigent-${version}.AppImage"; url = "https://github.com/eigent-ai/eigent/releases/download/v${version}/Eigent-${version}.AppImage";
hash = "sha256-9KuiFjegfXhCu1W/FCinWX4ae/DsNPudeBcXFfW18Hc="; hash = "sha256-mwCBx+D6mgGqQa8bDuUpo3h49EwFVkwasJwaYc6aXFE=";
}; };
appimageContents = appimageTools.extractType2 {inherit pname version src;}; appimageContents = appimageTools.extractType2 {inherit pname version src;};
in in

View File

@@ -31,7 +31,7 @@
# Upstream is missing outputHashes for git dependencies # Upstream is missing outputHashes for git dependencies
# Also fix stale npm deps hash in upstream node_modules FOD # Also fix stale npm deps hash in upstream node_modules FOD
fixedNodeModules = opencode.node_modules.overrideAttrs { fixedNodeModules = opencode.node_modules.overrideAttrs {
outputHash = "sha256-LRhPPrOKCGUSCEWTpAxPdWKTKVNkg82WrvD25cP3jts="; outputHash = "sha256-285KZ7rZLRoc6XqCZRHc25NE+mmpGh/BVeMpv8aPQtQ=";
}; };
opencode-desktop = rustPlatform.buildRustPackage (finalAttrs: { opencode-desktop = rustPlatform.buildRustPackage (finalAttrs: {

View File

@@ -12,17 +12,14 @@ let
} }
); );
in in
assert result.success == false; assert result.success == false; {result = "pass";};
{result = "pass";};
# Test 2: loadCanonical extracts loadAgents from input # Test 2: loadCanonical extracts loadAgents from input
testLoadCanonical = let testLoadCanonical = let
fakeInput = {lib.loadAgents = {test = {description = "test";};};}; fakeInput = {lib.loadAgents = {test = {description = "test";};};};
result = agentsLib.loadCanonical {agentsInput = fakeInput;}; result = agentsLib.loadCanonical {agentsInput = fakeInput;};
in in
assert result == {test = {description = "test";};}; assert result == {test = {description = "test";};}; {result = "pass";};
{result = "pass";};
in { in {
unknown-tool-throws = testUnknownTool; unknown-tool-throws = testUnknownTool;
load-canonical = testLoadCanonical; load-canonical = testLoadCanonical;

View File

@@ -11,11 +11,11 @@ let
rulesDir = ".coding-rules"; rulesDir = ".coding-rules";
}; };
in in
assert rules.instructions == [ assert rules.instructions
== [
".coding-rules/concerns/naming.md" ".coding-rules/concerns/naming.md"
".coding-rules/languages/python.md" ".coding-rules/languages/python.md"
]; ]; {result = "pass";};
{result = "pass";};
# Test 2: default rulesDir is .opencode-rules # Test 2: default rulesDir is .opencode-rules
testDefaultRulesDir = let testDefaultRulesDir = let
@@ -24,13 +24,10 @@ let
}; };
hasCorrectPrefix = builtins.all (s: builtins.substring 0 15 s == ".opencode-rules") rules.instructions; hasCorrectPrefix = builtins.all (s: builtins.substring 0 15 s == ".opencode-rules") rules.instructions;
in in
assert hasCorrectPrefix == true; assert hasCorrectPrefix == true; {result = "pass";};
{result = "pass";};
# Test 3: backward-compat alias exists # Test 3: backward-compat alias exists
testBackwardCompat = testBackwardCompat = assert codingRulesLib.mkOpencodeRules == codingRulesLib.mkCodingRules; {result = "pass";};
assert codingRulesLib.mkOpencodeRules == codingRulesLib.mkCodingRules;
{result = "pass";};
# Test 4: shellHook contains both the symlink command and the config generation # Test 4: shellHook contains both the symlink command and the config generation
testShellHook = let testShellHook = let
@@ -42,9 +39,7 @@ let
hasConfigGen = builtins.match ".*coding-rules.json.*" hook != null; hasConfigGen = builtins.match ".*coding-rules.json.*" hook != null;
in in
assert hasSymlink; assert hasSymlink;
assert hasConfigGen; assert hasConfigGen; {result = "pass";};
{result = "pass";};
in { in {
instructions-correct = testInstructions; instructions-correct = testInstructions;
default-rules-dir = testDefaultRulesDir; default-rules-dir = testDefaultRulesDir;