Merge branch 'chore/update-gitignore-and-changes'

This commit is contained in:
m3tm3re
2026-04-17 11:12:28 +02:00
17 changed files with 60 additions and 60 deletions

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

@@ -1,7 +0,0 @@
{
"success": true,
"clones": [],
"duplicatedLines": 0,
"totalLines": 0,
"percentage": 0
}

View File

@@ -1,3 +0,0 @@
{
"timestamp": "2026-04-15T09:30:34.459Z"
}

View File

@@ -1,9 +0,0 @@
{
"success": false,
"issues": [],
"unusedExports": [],
"unusedFiles": [],
"unusedDeps": [],
"unlistedDeps": [],
"summary": "Failed to parse output"
}

View File

@@ -1,3 +0,0 @@
{
"timestamp": "2026-04-15T09:30:35.667Z"
}

View File

@@ -1 +0,0 @@
null

View File

@@ -1,3 +0,0 @@
{
"timestamp": "2026-04-15T09:28:51.987Z"
}

View File

@@ -1,3 +0,0 @@
{
"items": []
}

View File

@@ -1,3 +0,0 @@
{
"timestamp": "2026-04-15T09:28:16.965Z"
}

View File

@@ -1,6 +0,0 @@
{
"files": {},
"turnCycles": 0,
"maxCycles": 3,
"lastUpdated": "2026-04-15T09:30:35.668Z"
}

View File

@@ -76,7 +76,10 @@ in {
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.

View File

@@ -60,6 +60,19 @@ in
cwd="$1" cwd="$1"
shift shift
# Parse forwarded environment variables from wrapper (KEY=VALUE)
while [ "$#" -gt 0 ]; do
case "$1" in
TERM=*|LANG=*|LC_ALL=*|LC_CTYPE=*|COLORTERM=*|TERM_PROGRAM=*)
export "$1"
shift
;;
*)
break
;;
esac
done
resolve_user_policy() { resolve_user_policy() {
local user="$1" local user="$1"
USER_CONFIG_PATH="" USER_CONFIG_PATH=""
@@ -384,5 +397,34 @@ in
${concatStringsSep "\n" (map (arg: ''cmd+=( ${escapeShellArg arg} )'') cfg.wrapper.extraRunArgs)} ${concatStringsSep "\n" (map (arg: ''cmd+=( ${escapeShellArg arg} )'') cfg.wrapper.extraRunArgs)}
cmd+=( "$@" ) cmd+=( "$@" )
exec "''${cmd[@]}" # Reset terminal keyboard protocol modes that pi's TUI may have enabled.
# If pi crashes or is killed (OOM, SIGKILL, etc.), its cleanup handler
# never runs and the host terminal stays in Kitty keyboard protocol or
# xterm modifyOtherKeys mode. This causes all keystrokes to appear as
# raw escape sequences like ^[[99;5u (ctrl+c in CSI-u encoding).
#
# Try /dev/tty first (controlling terminal), fall back to stdout
# (connected through sudo to the user's Ghostty terminal).
cleanup_terminal() {
local output_dev=""
if [ -w /dev/tty ]; then
output_dev=/dev/tty
elif [ -w /dev/stdout ]; then
output_dev=/dev/stdout
fi
if [ -n "$output_dev" ]; then
# Disable Kitty keyboard protocol (pop all flags)
printf '\033[<u' > "$output_dev" 2>/dev/null || true
# Disable xterm modifyOtherKeys
printf '\033[>4;0m' > "$output_dev" 2>/dev/null || true
# Disable bracketed paste mode
printf '\033[?2004l' > "$output_dev" 2>/dev/null || true
# Restore cursor visibility
printf '\033[?25h' > "$output_dev" 2>/dev/null || true
fi
}
trap cleanup_terminal EXIT
# Run without exec so the EXIT trap fires after pi exits (normal or crash).
"''${cmd[@]}"
'' ''

View File

@@ -97,6 +97,6 @@ with lib;
exec /run/wrappers/bin/sudo --non-interactive \ exec /run/wrappers/bin/sudo --non-interactive \
${runner}/bin/${cfg.wrapper.runnerName} \ ${runner}/bin/${cfg.wrapper.runnerName} \
"$user_name" "$cwd_real" \ "$user_name" "$cwd_real" \
"TERM=$TERM" "LANG=$LANG" "LC_ALL=''${LC_ALL:-}" "LC_CTYPE=''${LC_CTYPE:-}" "COLORTERM=''${COLORTERM:-}" \ "TERM=$TERM" "LANG=$LANG" "LC_ALL=''${LC_ALL:-}" "LC_CTYPE=''${LC_CTYPE:-}" "COLORTERM=''${COLORTERM:-}" "TERM_PROGRAM=''${TERM_PROGRAM:-}" \
"$@" "$@"
'' ''

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

@@ -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;