Compare commits
62 Commits
fbeb39ec22
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
29d1cdf894 | ||
|
|
7551a6b919 | ||
|
|
8bb7211ccc | ||
|
|
25512af24c | ||
|
|
3bd2f23e0d | ||
|
|
22b43adbb2 | ||
|
|
140b5cb682 | ||
|
|
291e3a0744 | ||
|
|
e830d37a9e | ||
|
|
eb9744a01d | ||
|
|
74f23ed9f1 | ||
|
|
2d0311cd15 | ||
|
|
3e49f81c76 | ||
|
|
2d2c545c10 | ||
|
|
106aa3749f | ||
|
|
89197e81e4 | ||
|
|
8ab4fba471 | ||
|
|
3ebda192e9 | ||
|
|
68964eb099 | ||
|
|
7b9fc8f280 | ||
|
|
1fe74b6d7d | ||
|
|
11f3da30c3 | ||
|
|
be401c2ebb | ||
|
|
41e6ea8280 | ||
|
|
6693c09465 | ||
|
|
51d79fbbcf | ||
|
|
9ef17eb7eb | ||
|
|
81cffd22cb | ||
|
|
c2c0201295 | ||
|
|
47cace3dd1 | ||
|
|
bfa707c11d | ||
|
|
e22774539a | ||
|
|
166ed9e825 | ||
|
|
5b55f47020 | ||
|
|
f95fe5bf6d | ||
|
|
34dda52d53 | ||
|
|
06a40240ea | ||
|
|
ad0bc14461 | ||
|
|
6d262127e7 | ||
|
|
839d7ae743 | ||
|
|
2e37c16ac7 | ||
|
|
3b99d1215e | ||
|
|
f05865972b | ||
|
|
58312b2ca2 | ||
|
|
dc206b13e2 | ||
|
|
d43bb33dcb | ||
|
|
d2ec6a0474 | ||
|
|
f69dd15474 | ||
|
|
c7935658e6 | ||
|
|
af56407296 | ||
|
|
51dd2be6ea | ||
|
|
6ebd7b94d5 | ||
|
|
22bfba739d | ||
|
|
9d27e48b2b | ||
|
|
3f26c44b5a | ||
|
|
6775659538 | ||
|
|
b80422c16e | ||
|
|
a6c1d7cf97 | ||
|
|
e6c22a04d7 | ||
|
|
56a7a7bfa8 | ||
|
|
42cd0849b4 | ||
|
|
47b622745d |
@@ -52,72 +52,91 @@ jobs:
|
||||
"https://m3tam3re@code.m3ta.dev/m3tam3re/nixpkgs.git" \
|
||||
"$REPO_DIR"
|
||||
|
||||
- name: Update opencode Flake Input
|
||||
id: update-opencode
|
||||
- name: Update All Flake Inputs
|
||||
id: update-flake-inputs
|
||||
run: |
|
||||
cd "$REPO_DIR"
|
||||
|
||||
echo "::group::Checking for opencode updates"
|
||||
echo "::group::Discovering version-pinned flake inputs"
|
||||
|
||||
# Get latest release from GitHub API (strip v prefix for comparison)
|
||||
LATEST_RELEASE=$(curl -s "https://api.github.com/repos/anomalyco/opencode/releases/latest" | jq -r '.tag_name' | sed 's/^v//')
|
||||
# Get GitHub inputs with version refs (e.g., v1.2.9)
|
||||
VERSIONED_INPUTS=$(nix flake metadata --json | jq -r '
|
||||
.locks.nodes | to_entries[] |
|
||||
select(.value.original.type == "github") |
|
||||
select(.value.original.ref != null) |
|
||||
select(.value.original.ref | test("^v?[0-9]+\\.[0-9]+")) |
|
||||
"\(.key) \(.value.original.owner) \(.value.original.repo) \(.value.original.ref)"
|
||||
')
|
||||
|
||||
# Extract current version from flake.nix
|
||||
CURRENT_VERSION=$(grep 'anomalyco/opencode' flake.nix | grep -oP 'v\K[0-9.]+')
|
||||
echo "Discovered version-pinned inputs:"
|
||||
echo "$VERSIONED_INPUTS"
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "Current opencode version: $CURRENT_VERSION"
|
||||
echo "Latest opencode version: $LATEST_RELEASE"
|
||||
UPDATED_INPUTS=""
|
||||
FAILED_INPUTS=""
|
||||
|
||||
# Check if update is needed
|
||||
if [ "$LATEST_RELEASE" != "$CURRENT_VERSION" ]; then
|
||||
echo "🔄 Updating opencode from $CURRENT_VERSION to $LATEST_RELEASE"
|
||||
# Update each version-pinned input
|
||||
while read -r INPUT_NAME OWNER REPO CURRENT_REF; do
|
||||
[ -z "$INPUT_NAME" ] && continue
|
||||
|
||||
# Update flake.nix with new version
|
||||
sed -i 's|url = "github:anomalyco/opencode/v.*"|url = "github:anomalyco/opencode/v'"$LATEST_RELEASE"'"|' flake.nix
|
||||
echo "::group::Checking $INPUT_NAME ($OWNER/$REPO)"
|
||||
|
||||
# Update flake lock to fetch new revision
|
||||
nix flake update opencode
|
||||
# Get latest stable release (exclude prereleases)
|
||||
# The /releases/latest endpoint already returns the latest non-prerelease, non-draft release
|
||||
LATEST=$(curl -sf "https://api.github.com/repos/$OWNER/$REPO/releases/latest" | \
|
||||
jq -r 'if .prerelease == false then .tag_name else empty end')
|
||||
|
||||
# Format with alejandra
|
||||
if [ -z "$LATEST" ]; then
|
||||
echo "⚠️ No stable release found for $INPUT_NAME (repo may only have prereleases)"
|
||||
FAILED_INPUTS="$FAILED_INPUTS $INPUT_NAME(no-stable-release)"
|
||||
echo "::endgroup::"
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "Current: $CURRENT_REF | Latest: $LATEST"
|
||||
|
||||
if [ "$LATEST" != "$CURRENT_REF" ]; then
|
||||
echo "Updating $INPUT_NAME from $CURRENT_REF to $LATEST"
|
||||
|
||||
# Update flake.nix
|
||||
sed -i "s|github:$OWNER/$REPO/[^\"']*|github:$OWNER/$REPO/$LATEST|g" flake.nix
|
||||
|
||||
# Update flake.lock for this input
|
||||
if nix flake update "$INPUT_NAME" 2>&1 | tee /tmp/input-update.log; then
|
||||
UPDATED_INPUTS="$UPDATED_INPUTS $INPUT_NAME($LATEST)"
|
||||
echo "✅ Updated $INPUT_NAME to $LATEST"
|
||||
else
|
||||
echo "❌ Failed to update $INPUT_NAME"
|
||||
FAILED_INPUTS="$FAILED_INPUTS $INPUT_NAME(update-failed)"
|
||||
git checkout flake.nix flake.lock 2>/dev/null || true
|
||||
fi
|
||||
else
|
||||
echo "✓ $INPUT_NAME is already up to date"
|
||||
fi
|
||||
echo "::endgroup::"
|
||||
done <<< "$VERSIONED_INPUTS"
|
||||
|
||||
echo "::group::Updating non-version-pinned inputs"
|
||||
# Update all non-version-pinned inputs (branches, no-ref)
|
||||
nix flake update
|
||||
echo "::endgroup::"
|
||||
|
||||
# Check if we have any changes
|
||||
if [ -n "$(git status --porcelain flake.nix flake.lock)" ]; then
|
||||
echo "::group::Committing flake input updates"
|
||||
nix fmt flake.nix
|
||||
|
||||
# Verify the update
|
||||
echo "::endgroup::"
|
||||
echo "::group::Verifying opencode update"
|
||||
|
||||
# Run flake check
|
||||
if ! nix flake check; then
|
||||
echo "❌ Flake check failed after opencode update"
|
||||
git checkout flake.nix flake.lock
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Build opencode package
|
||||
if ! nix build .#opencode 2>&1 | tee /tmp/opencode-build.log; then
|
||||
echo "❌ Build failed for opencode"
|
||||
git checkout flake.nix flake.lock
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ Flake check passed"
|
||||
echo "✅ Build successful for opencode"
|
||||
echo "::endgroup::"
|
||||
|
||||
# Commit the change
|
||||
echo "::group::Committing opencode update"
|
||||
git add flake.nix flake.lock
|
||||
git commit -m "chore: update opencode flake input to $LATEST_RELEASE"
|
||||
|
||||
echo "opencode_update=true" >> $GITHUB_OUTPUT
|
||||
echo "opencode_version=${LATEST_RELEASE}" >> $GITHUB_OUTPUT
|
||||
COMMIT_MSG="chore: update flake inputs"
|
||||
[ -n "$UPDATED_INPUTS" ] && COMMIT_MSG="$COMMIT_MSG - $(echo $UPDATED_INPUTS | tr ' ' ', ')"
|
||||
|
||||
git commit -m "$COMMIT_MSG"
|
||||
echo "flake_inputs_updated=true" >> $GITHUB_OUTPUT
|
||||
echo "updated_inputs=${UPDATED_INPUTS# }" >> $GITHUB_OUTPUT
|
||||
[ -n "$FAILED_INPUTS" ] && echo "failed_inputs=${FAILED_INPUTS# }" >> $GITHUB_OUTPUT
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "✅ Updated opencode to $LATEST_RELEASE"
|
||||
else
|
||||
echo "✓ opencode is already up to date"
|
||||
echo "opencode_update=false" >> $GITHUB_OUTPUT
|
||||
echo "opencode_version=${CURRENT_VERSION}" >> $GITHUB_OUTPUT
|
||||
echo "::endgroup::"
|
||||
echo "flake_inputs_updated=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Check Prerequisites
|
||||
@@ -150,21 +169,130 @@ jobs:
|
||||
[ "$1" != "$(git rev-parse HEAD)" ] && echo "true" || echo "false"
|
||||
}
|
||||
|
||||
has_update_script() {
|
||||
local pkg=$1
|
||||
# Check if package has passthru.updateScript attribute
|
||||
nix eval .#${pkg}.passthru.updateScript --json >/dev/null 2>&1
|
||||
}
|
||||
has_update_script() {
|
||||
local pkg=$1
|
||||
# Check if package has passthru.updateScript attribute
|
||||
nix eval .#${pkg}.passthru.updateScript --json >/dev/null 2>&1
|
||||
}
|
||||
|
||||
run_update() {
|
||||
# Check if updateScript is a custom script (path-based) vs nix-update-script
|
||||
is_custom_update_script() {
|
||||
local pkg=$1
|
||||
local result
|
||||
# nix-update-script returns a list like [ "/nix/store/...-nix-update/bin/nix-update" ]
|
||||
# Custom scripts return a path like "/nix/store/.../update.sh"
|
||||
result=$(nix eval --impure --raw --expr "
|
||||
let
|
||||
flake = builtins.getFlake (toString ./.);
|
||||
pkg = flake.packages.\${builtins.currentSystem}.${pkg};
|
||||
script = pkg.passthru.updateScript or [];
|
||||
in
|
||||
if builtins.isPath script then
|
||||
\"custom\"
|
||||
else if builtins.isList script && builtins.length script > 0 then
|
||||
let first = builtins.head script;
|
||||
in if builtins.isString first && builtins.match \".*/nix-update$\" first != null then
|
||||
\"nix-update-script\"
|
||||
else if builtins.isPath first then
|
||||
\"custom\"
|
||||
else
|
||||
\"other\"
|
||||
else if builtins.isAttrs script && script ? command then
|
||||
if builtins.isPath script.command then \"custom\"
|
||||
else if builtins.isList script.command && builtins.isPath (builtins.head script.command) then \"custom\"
|
||||
else \"other\"
|
||||
else
|
||||
\"other\"
|
||||
" 2>/dev/null || echo "other")
|
||||
[[ "$result" == "custom" ]]
|
||||
}
|
||||
|
||||
# Run a custom update script directly (for packages like n8n)
|
||||
run_custom_update_script() {
|
||||
local pkg=$1
|
||||
local before_hash=$(git rev-parse HEAD)
|
||||
|
||||
echo "::group::Updating $pkg"
|
||||
echo " 🔧 Detected custom update script for $pkg"
|
||||
|
||||
local args=("--flake" "--commit" "--use-github-releases")
|
||||
# Get package metadata for environment variables
|
||||
local name pname version
|
||||
name=$(nix eval --raw .#${pkg}.name 2>/dev/null || echo "$pkg")
|
||||
pname=$(nix eval --raw .#${pkg}.pname 2>/dev/null || echo "$pkg")
|
||||
version=$(nix eval --raw .#${pkg}.version 2>/dev/null || echo "unknown")
|
||||
|
||||
args+=("$pkg")
|
||||
# Run the custom script using nix develop
|
||||
if nix develop --impure --expr "
|
||||
with builtins;
|
||||
let
|
||||
flake = getFlake (toString ./.);
|
||||
pkgs = flake.inputs.nixpkgs.legacyPackages.\${currentSystem};
|
||||
pkg' = flake.packages.\${currentSystem}.${pkg};
|
||||
script = pkg'.passthru.updateScript;
|
||||
cmd = if isAttrs script then script.command else script;
|
||||
scriptPath = if isList cmd then head cmd else cmd;
|
||||
in pkgs.mkShell {
|
||||
inputsFrom = [pkg'];
|
||||
packages = with pkgs; [ curl jq git ];
|
||||
}
|
||||
" --command bash -c "
|
||||
export UPDATE_NIX_NAME='${name}'
|
||||
export UPDATE_NIX_PNAME='${pname}'
|
||||
export UPDATE_NIX_OLD_VERSION='${version}'
|
||||
export UPDATE_NIX_ATTR_PATH='${pkg}'
|
||||
|
||||
# Get the script path and execute it
|
||||
script_path=\$(nix eval --impure --raw --expr '
|
||||
let
|
||||
flake = builtins.getFlake (toString ./.);
|
||||
pkg = flake.packages.\${builtins.currentSystem}.${pkg};
|
||||
script = pkg.passthru.updateScript;
|
||||
cmd = if builtins.isAttrs script then script.command else script;
|
||||
in if builtins.isList cmd then toString (builtins.head cmd)
|
||||
else toString cmd
|
||||
' 2>/dev/null)
|
||||
|
||||
if [ -n \"\$script_path\" ]; then
|
||||
echo \"Running: \$script_path\"
|
||||
bash \"\$script_path\"
|
||||
fi
|
||||
" 2>&1 | tee /tmp/update-${pkg}.log; then
|
||||
if [ "$(check_commit "$before_hash")" = "true" ]; then
|
||||
echo "✅ Updated $pkg (via custom script)"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
|
||||
# Clean up on failure
|
||||
git checkout -- . 2>/dev/null || true
|
||||
git clean -fd 2>/dev/null || true
|
||||
|
||||
if ! grep -q "already up to date\|No new version found" /tmp/update-${pkg}.log; then
|
||||
echo "⚠️ Custom update script failed for $pkg"
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
run_update() {
|
||||
local pkg=$1
|
||||
local before_hash=$(git rev-parse HEAD)
|
||||
|
||||
echo "::group::Updating $pkg"
|
||||
|
||||
# Check if this package has a custom update script
|
||||
if is_custom_update_script "$pkg"; then
|
||||
if run_custom_update_script "$pkg"; then
|
||||
echo "::endgroup::"
|
||||
return 0
|
||||
else
|
||||
echo "::endgroup::"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Standard nix-update for packages with nix-update-script
|
||||
local args=("--flake" "--commit" "--use-github-releases")
|
||||
|
||||
args+=("$pkg")
|
||||
|
||||
if nix-update "${args[@]}" 2>&1 | tee /tmp/update-${pkg}.log; then
|
||||
if [ "$(check_commit "$before_hash")" = "true" ]; then
|
||||
@@ -251,7 +379,7 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Verify Builds
|
||||
if: steps.update.outputs.has_updates == 'true' || steps.update-opencode.outputs.opencode_update == 'true'
|
||||
if: steps.update.outputs.has_updates == 'true' || steps.update-flake-inputs.outputs.flake_inputs_updated == 'true'
|
||||
run: |
|
||||
cd "$REPO_DIR"
|
||||
|
||||
@@ -303,16 +431,17 @@ jobs:
|
||||
echo "✅ All packages built successfully: ${SUCCESSFUL_PACKAGES[*]}"
|
||||
|
||||
- name: Push Changes
|
||||
if: steps.update.outputs.has_updates == 'true' || steps.update-opencode.outputs.opencode_update == 'true'
|
||||
if: steps.update.outputs.has_updates == 'true' || steps.update-flake-inputs.outputs.flake_inputs_updated == 'true'
|
||||
run: |
|
||||
cd "$REPO_DIR"
|
||||
PACKAGES="${{ steps.update.outputs.updated_packages }}"
|
||||
|
||||
if [ "${{ steps.update-opencode.outputs.opencode_update }}" = "true" ]; then
|
||||
if [ "${{ steps.update-flake-inputs.outputs.flake_inputs_updated }}" = "true" ]; then
|
||||
UPDATED_INPUTS="${{ steps.update-flake-inputs.outputs.updated_inputs }}"
|
||||
if [ -n "$PACKAGES" ]; then
|
||||
PACKAGES="$PACKAGES, opencode"
|
||||
PACKAGES="$PACKAGES, flake inputs ($UPDATED_INPUTS)"
|
||||
else
|
||||
PACKAGES="opencode"
|
||||
PACKAGES="flake inputs ($UPDATED_INPUTS)"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -370,12 +499,26 @@ jobs:
|
||||
echo "\`${{ steps.update.outputs.updated_packages }}\`" >> $GITHUB_STEP_SUMMARY
|
||||
fi
|
||||
|
||||
if [ "${{ steps.update-opencode.outputs.opencode_update }}" = "true" ]; then
|
||||
if [ "${{ steps.update-flake-inputs.outputs.flake_inputs_updated }}" = "true" ]; then
|
||||
HAS_UPDATES="true"
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
echo "## Updated Flake Input" >> $GITHUB_STEP_SUMMARY
|
||||
echo "## Updated Flake Inputs" >> $GITHUB_STEP_SUMMARY
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
echo "- **opencode**: \`v${{ steps.update-opencode.outputs.opencode_version }}\`" >> $GITHUB_STEP_SUMMARY
|
||||
UPDATED_INPUTS="${{ steps.update-flake-inputs.outputs.updated_inputs }}"
|
||||
if [ -n "$UPDATED_INPUTS" ]; then
|
||||
echo "$UPDATED_INPUTS" | tr ' ' '\n' | while read -r input; do
|
||||
[ -n "$input" ] && echo "- **$input**" >> $GITHUB_STEP_SUMMARY
|
||||
done
|
||||
fi
|
||||
FAILED_INPUTS="${{ steps.update-flake-inputs.outputs.failed_inputs }}"
|
||||
if [ -n "$FAILED_INPUTS" ]; then
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
echo "### Failed Inputs" >> $GITHUB_STEP_SUMMARY
|
||||
echo "" >> $GITHUB_STEP_SUMMARY
|
||||
echo "$FAILED_INPUTS" | tr ' ' '\n' | while read -r input; do
|
||||
[ -n "$input" ] && echo "- $input" >> $GITHUB_STEP_SUMMARY
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$HAS_UPDATES" = "true" ]; then
|
||||
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -32,3 +32,8 @@ test-result/
|
||||
local.nix
|
||||
flake.lock.bak
|
||||
.todos/
|
||||
|
||||
# AI agent state
|
||||
.sidecar/
|
||||
.sidecar-*
|
||||
.sisyphus/
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
opencode
|
||||
@@ -1 +0,0 @@
|
||||
master
|
||||
@@ -1 +0,0 @@
|
||||
td-84727a
|
||||
20
AGENTS.md
20
AGENTS.md
@@ -5,8 +5,8 @@
|
||||
You must run td usage --new-session at conversation start (or after /clear) to see current work.
|
||||
Use td usage -q for subsequent reads.
|
||||
|
||||
**Generated:** 2026-01-13
|
||||
**Commit:** 366af12
|
||||
**Generated:** 2026-02-14
|
||||
**Commit:** dc2f3b6
|
||||
**Branch:** master
|
||||
|
||||
## OVERVIEW
|
||||
@@ -155,16 +155,16 @@ Types: `feat`, `fix`, `docs`, `style`, `refactor`, `chore`
|
||||
- **Dev shell tools**: `statix`, `deadnix` only available inside `nix develop`
|
||||
- **Automated package updates**: Packages are automatically updated weekly via Gitea Actions using `nix-update`. Review PRs from the automation before merging. For urgent updates, manually run the workflow or update manually.
|
||||
|
||||
## Issue Tracking
|
||||
## Task Management
|
||||
|
||||
This project uses **bd (beads)** for issue tracking.
|
||||
Run `bd prime` for workflow context, or install hooks (`bd hooks install`) for auto-injection.
|
||||
This project uses **td** for tracking tasks across AI coding sessions.
|
||||
Run `td usage --new-session` at conversation start to see current work.
|
||||
Use `td usage -q` for subsequent reads.
|
||||
|
||||
**Quick reference:**
|
||||
|
||||
- `bd ready` - Find unblocked work
|
||||
- `bd create "Title" --type task --priority 2` - Create issue
|
||||
- `bd close <id>` - Complete work
|
||||
- `bd sync` - Sync with git (run at session end)
|
||||
- `td usage --new-session` - Start new session and view tasks
|
||||
- `td usage -q` - Quick view of current tasks (subsequent reads)
|
||||
- `td version` - Check version
|
||||
|
||||
For full workflow details: `bd prime`
|
||||
For full workflow details, see the [td documentation](./docs/packages/td.md).
|
||||
|
||||
@@ -40,18 +40,19 @@ nix run git+https://code.m3ta.dev/m3tam3re/nixpkgs#zellij-ps
|
||||
|
||||
| Package | Description |
|
||||
| ------------------ | ------------------------------------- |
|
||||
| `beads` | Lightweight memory system for AI coding agents with graph-based issue tracking |
|
||||
| `code2prompt` | Convert code to prompts |
|
||||
| `hyprpaper-random` | Random wallpaper setter for Hyprpaper |
|
||||
| `launch-webapp` | Launch web applications |
|
||||
| `mem0` | AI memory assistant with vector storage |
|
||||
| `msty-studio` | Msty Studio application |
|
||||
| `n8n` | Free and source-available fair-code licensed workflow automation tool |
|
||||
| `opencode` | AI coding agent built for the terminal |
|
||||
| `notesmd-cli` | Obsidian CLI (Community) - Interact with Obsidian in the terminal |
|
||||
| `opencode-desktop` | OpenCode Desktop App with Wayland support (includes workaround for upstream issue #11755) |
|
||||
| `pomodoro-timer` | Pomodoro timer utility |
|
||||
| `rofi-project-opener` | Rofi-based project launcher |
|
||||
| `sidecar` | Companion tool for CLI agents with diffs, file trees, and task management |
|
||||
| `stt-ptt` | Push to Talk Speech to Text |
|
||||
| `td` | Minimalist CLI for tracking tasks across AI coding sessions |
|
||||
| `tuxedo-backlight` | Backlight control for Tuxedo laptops |
|
||||
| `zellij-ps` | Project switcher for Zellij |
|
||||
|
||||
|
||||
@@ -28,17 +28,18 @@ Step-by-step guides for common tasks:
|
||||
|
||||
Documentation for all custom packages:
|
||||
|
||||
- [beads](./packages/beads.md) - Lightweight memory system for AI coding agents with graph-based issue tracking
|
||||
- [code2prompt](./packages/code2prompt.md) - Convert code to prompts
|
||||
- [hyprpaper-random](./packages/hyprpaper-random.md) - Random wallpaper setter for Hyprpaper
|
||||
- [launch-webapp](./packages/launch-webapp.md) - Launch web applications
|
||||
- [mem0](./packages/mem0.md) - AI memory assistant with vector storage
|
||||
- [msty-studio](./packages/msty-studio.md) - Msty Studio application
|
||||
- [n8n](./packages/n8n.md) - Free and source-available fair-code licensed workflow automation tool
|
||||
- [opencode](./packages/opencode.md) - AI coding agent built for terminal
|
||||
- [notesmd-cli](./packages/notesmd-cli.md) - Obsidian CLI (Community) - Interact with Obsidian in the terminal
|
||||
- [pomodoro-timer](./packages/pomodoro-timer.md) - Pomodoro timer utility
|
||||
- [rofi-project-opener](./packages/rofi-project-opener.md) - Rofi-based project launcher with custom args
|
||||
- [sidecar](./packages/sidecar.md) - Companion tool for CLI agents with diffs, file trees, and task management
|
||||
- [stt-ptt](./packages/stt-ptt.md) - Push to Talk Speech to Text using Whisper
|
||||
- [td](./packages/td.md) - Minimalist CLI for tracking tasks across AI coding sessions
|
||||
- [tuxedo-backlight](./packages/tuxedo-backlight.md) - Backlight control for Tuxedo laptops
|
||||
- [zellij-ps](./packages/zellij-ps.md) - Project switcher for Zellij
|
||||
|
||||
|
||||
@@ -1,220 +1,23 @@
|
||||
# beads
|
||||
# beads (Removed)
|
||||
|
||||
Lightweight memory system for AI coding agents with graph-based issue tracking.
|
||||
> **Note**: The `beads` package has been removed from this repository.
|
||||
|
||||
## Description
|
||||
## Why was it removed?
|
||||
|
||||
beads is a command-line tool designed to provide persistent memory and issue tracking for AI coding agents. It features a graph-based system for managing issues, dependencies, and discovered work across development sessions.
|
||||
The beads package was removed as it is no longer actively used.
|
||||
|
||||
## Features
|
||||
## What was beads?
|
||||
|
||||
- 🧠 **Persistent Memory**: Store and retrieve context across AI sessions
|
||||
- 📊 **Graph-Based Issue Tracking**: Manage issues with dependency relationships
|
||||
- 🔄 **Discovered Work**: Track work discovered during development
|
||||
- 🎯 **Multi-Session Continuity**: Resume work from previous sessions
|
||||
- 📝 **Git Integration**: Seamless integration with git workflows
|
||||
- 🐚 **Shell Completions**: Bash, Fish, and Zsh completions included
|
||||
Beads was a lightweight memory system for AI coding agents with graph-based issue tracking. It provided:
|
||||
- Persistent memory across AI sessions
|
||||
- Graph-based issue tracking with dependencies
|
||||
- Discovered work tracking
|
||||
- Git integration
|
||||
|
||||
## Installation
|
||||
|
||||
### Via Overlay
|
||||
|
||||
```nix
|
||||
{pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
beads
|
||||
];
|
||||
}
|
||||
```
|
||||
|
||||
### Direct Reference
|
||||
|
||||
```nix
|
||||
{pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
inputs.m3ta-nixpkgs.packages.${pkgs.system}.beads
|
||||
];
|
||||
}
|
||||
```
|
||||
|
||||
### Run Directly
|
||||
If you need beads, you can still build it from source:
|
||||
|
||||
```bash
|
||||
nix run git+https://code.m3ta.dev/m3tam3re/nixpkgs#beads
|
||||
git clone https://github.com/steveyegge/beads
|
||||
cd beads
|
||||
go build ./cmd/bd
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Basic Commands
|
||||
|
||||
```bash
|
||||
# Show available issues ready to work on
|
||||
bd ready
|
||||
|
||||
# Create a new issue
|
||||
bd create "Fix authentication bug" --type bug --priority 2
|
||||
|
||||
# Show issue details
|
||||
bd show beads-123
|
||||
|
||||
# Update issue status
|
||||
bd update beads-123 --status in_progress
|
||||
|
||||
# Close completed issues
|
||||
bd close beads-123
|
||||
|
||||
# Sync with git remote
|
||||
bd sync
|
||||
```
|
||||
|
||||
### Issue Types
|
||||
|
||||
- `task`: General tasks
|
||||
- `bug`: Bug fixes
|
||||
- `feature`: New features
|
||||
- `epic`: Large-scale initiatives
|
||||
|
||||
### Priority Levels
|
||||
|
||||
- `0` (P0): Critical
|
||||
- `1` (P1): High
|
||||
- `2` (P2): Medium
|
||||
- `3` (P3): Low
|
||||
- `4` (P4): Backlog
|
||||
|
||||
### Dependency Management
|
||||
|
||||
```bash
|
||||
# Add dependency (beads-123 depends on beads-456)
|
||||
bd dep add beads-123 beads-456
|
||||
|
||||
# Show blocked issues
|
||||
bd blocked
|
||||
|
||||
# Show what blocks an issue
|
||||
bd show beads-123 --blocked-by
|
||||
```
|
||||
|
||||
## Advanced Usage
|
||||
|
||||
### Finding Work
|
||||
|
||||
```bash
|
||||
# Show ready tasks (no blockers)
|
||||
bd ready
|
||||
|
||||
# Show all open issues
|
||||
bd list --status open
|
||||
|
||||
# Show in-progress work
|
||||
bd list --status in_progress
|
||||
```
|
||||
|
||||
### Assignment
|
||||
|
||||
```bash
|
||||
# Assign issue to yourself
|
||||
bd update beads-123 --assignee username
|
||||
|
||||
# Create assigned issue
|
||||
bd create "Review PR" --assignee reviewer
|
||||
```
|
||||
|
||||
### Bulk Operations
|
||||
|
||||
```bash
|
||||
# Close multiple issues at once
|
||||
bd close beads-123 beads-456 beads-789
|
||||
|
||||
# Close with reason
|
||||
bd close beads-123 --reason "Completed in v1.2.0"
|
||||
```
|
||||
|
||||
### Hooks
|
||||
|
||||
```bash
|
||||
# Install git hooks for automatic sync
|
||||
bd hooks install
|
||||
|
||||
# Remove hooks
|
||||
bd hooks uninstall
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
### Environment Variables
|
||||
|
||||
- `BEADS_DATA_DIR`: Custom directory for beads data (default: `.beads/`)
|
||||
- `BEADS_CONFIG`: Custom configuration file path
|
||||
- `BEADS_EDITOR`: Default editor for editing issues
|
||||
|
||||
### Git Integration
|
||||
|
||||
beads integrates with git for version-controlled issue tracking:
|
||||
|
||||
- Automatic sync before commits (via hooks)
|
||||
- Issue references in commit messages
|
||||
- Branch name tracking
|
||||
- Git-aware issue states
|
||||
|
||||
## Workflow Integration
|
||||
|
||||
### Typical Development Workflow
|
||||
|
||||
1. **Start session**: `bd prime` or check `bd ready`
|
||||
2. **Claim work**: `bd update beads-123 --status in_progress`
|
||||
3. **Work on task**: Implement changes
|
||||
4. **Discover new work**: `bd create "Discovered subtask"` as needed
|
||||
5. **Complete task**: `bd close beads-123`
|
||||
6. **Sync**: `bd sync` (automatic via hooks)
|
||||
|
||||
### Team Collaboration
|
||||
|
||||
```bash
|
||||
# Create issue and assign
|
||||
bd create "Implement feature X" --assignee dev1
|
||||
|
||||
# Review assigned work
|
||||
bd list --assignee yourname
|
||||
|
||||
# Close with review notes
|
||||
bd close beads-123 --reason "Reviewed and approved"
|
||||
```
|
||||
|
||||
## Shell Completions
|
||||
|
||||
beads provides shell completions for bash, fish, and zsh:
|
||||
|
||||
```bash
|
||||
# Bash completions are auto-loaded
|
||||
source <(bd completion bash)
|
||||
|
||||
# Fish completions
|
||||
bd completion fish | source
|
||||
|
||||
# Zsh completions
|
||||
bd completion zsh > ~/.zfunc/_bd
|
||||
```
|
||||
|
||||
## Build Information
|
||||
|
||||
- **Version**: 0.47.1
|
||||
- **Language**: Go
|
||||
- **License**: MIT
|
||||
- **Source**: [GitHub](https://github.com/steveyegge/beads)
|
||||
|
||||
## Platform Support
|
||||
|
||||
- Linux
|
||||
- macOS
|
||||
|
||||
## Notes
|
||||
|
||||
- Tests are disabled in the Nix package due to git worktree operations that fail in the sandbox
|
||||
- Security tests on Darwin are skipped due to `/etc/passwd` unavailability in sandbox
|
||||
- Shell completions are installed for platforms that can execute the build target
|
||||
|
||||
## Related
|
||||
|
||||
- [Adding Packages](../guides/adding-packages.md) - How to add new packages
|
||||
- [Quick Start](../QUICKSTART.md) - Getting started guide
|
||||
|
||||
117
docs/packages/notesmd-cli.md
Normal file
117
docs/packages/notesmd-cli.md
Normal file
@@ -0,0 +1,117 @@
|
||||
# notesmd-cli
|
||||
|
||||
Obsidian CLI (Community) - Interact with Obsidian in the terminal.
|
||||
|
||||
## Description
|
||||
|
||||
notesmd-cli is a command-line interface for interacting with Obsidian, the popular knowledge management and note-taking application. It allows you to create, search, and manipulate notes directly from the terminal.
|
||||
|
||||
## Features
|
||||
|
||||
- 📝 **Note Creation**: Create new notes from the command line
|
||||
- 🔍 **Search**: Search through your Obsidian vault
|
||||
- 📂 **Vault Management**: Interact with your vault structure
|
||||
- 🔗 **WikiLink Support**: Work with Obsidian's WikiLink format
|
||||
- 🏷️ **Tag Support**: Manage and search by tags
|
||||
- ⚡ **Fast**: Lightweight Go binary with no external dependencies
|
||||
|
||||
## Installation
|
||||
|
||||
### Via Overlay
|
||||
|
||||
```nix
|
||||
{pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
notesmd-cli
|
||||
];
|
||||
}
|
||||
```
|
||||
|
||||
### Direct Reference
|
||||
|
||||
```nix
|
||||
{pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
inputs.m3ta-nixpkgs.packages.${pkgs.system}.notesmd-cli
|
||||
];
|
||||
}
|
||||
```
|
||||
|
||||
### Run Directly
|
||||
|
||||
```bash
|
||||
nix run git+https://code.m3ta.dev/m3tam3re/nixpkgs#notesmd-cli
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Basic Commands
|
||||
|
||||
```bash
|
||||
# Show help
|
||||
notesmd-cli --help
|
||||
|
||||
# Create a new note
|
||||
notesmd-cli new "My Note Title"
|
||||
|
||||
# Search notes
|
||||
notesmd-cli search "search term"
|
||||
|
||||
# List notes
|
||||
notesmd-cli list
|
||||
```
|
||||
|
||||
### Working with Vaults
|
||||
|
||||
```bash
|
||||
# Specify vault path
|
||||
notesmd-cli --vault /path/to/vault new "Note Title"
|
||||
|
||||
# Open a note in Obsidian
|
||||
notesmd-cli open "Note Name"
|
||||
```
|
||||
|
||||
### Advanced Usage
|
||||
|
||||
```bash
|
||||
# Search with tags
|
||||
notesmd-cli search --tag "project"
|
||||
|
||||
# Append to existing note
|
||||
notesmd-cli append "Note Name" "Additional content"
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
### Environment Variables
|
||||
|
||||
- `OBSIDIAN_VAULT`: Default vault path
|
||||
|
||||
### Command Line Options
|
||||
|
||||
Run `notesmd-cli --help` for a complete list of options.
|
||||
|
||||
## Build Information
|
||||
|
||||
- **Version**: 0.3.0
|
||||
- **Language**: Go
|
||||
- **License**: MIT
|
||||
- **Source**: [GitHub](https://github.com/Yakitrak/notesmd-cli)
|
||||
- **Vendor Hash**: null (no external dependencies)
|
||||
|
||||
## Platform Support
|
||||
|
||||
- Linux
|
||||
- macOS (Unix systems)
|
||||
|
||||
## Notes
|
||||
|
||||
- No vendor dependencies (pure Go stdlib)
|
||||
- The binary is named `notesmd-cli` (not `notesmd`)
|
||||
- This is the community CLI, not the official Obsidian CLI
|
||||
|
||||
## Related
|
||||
|
||||
- [Obsidian](https://obsidian.md) - The Obsidian application
|
||||
- [Adding Packages](../guides/adding-packages.md) - How to add new packages
|
||||
- [Quick Start](../QUICKSTART.md) - Getting started guide
|
||||
@@ -1,346 +1,37 @@
|
||||
# opencode
|
||||
# opencode (Deprecated)
|
||||
|
||||
AI coding agent built for the terminal that can build anything. Combines a TypeScript/JavaScript core with a Go-based TUI for an interactive AI coding experience.
|
||||
> **Note**: The `opencode` package has been removed from this repository.
|
||||
|
||||
## Description
|
||||
## Why was it removed?
|
||||
|
||||
OpenCode is a terminal-based AI coding agent designed for power users. It provides a comprehensive development environment with AI assistance, code generation, refactoring, and project management capabilities. The tool features a sophisticated TUI (Terminal User Interface) built with Go, while the core functionality is implemented in TypeScript/JavaScript.
|
||||
OpenCode (CLI version) has been removed because there is now a well-maintained upstream repository for AI coding tools:
|
||||
|
||||
## Features
|
||||
**[numtide/llm-agents.nix](https://github.com/numtide/llm-agents.nix)**
|
||||
|
||||
- 🤖 **AI-Powered Coding**: Generate, refactor, and optimize code with AI assistance
|
||||
- 🖥️ **Modern TUI**: Beautiful terminal interface built with Go
|
||||
- 🔍 **Code Understanding**: Parse and understand existing codebases
|
||||
- 🌳 **Tree-Sitter Integration**: Accurate syntax highlighting and code structure analysis
|
||||
- 📁 **Project Management**: Navigate and manage projects efficiently
|
||||
- 🧠 **Multi-LLM Support**: Works with various language models (OpenAI, Anthropic, etc.)
|
||||
- 📝 **Code Generation**: Create new files and features from natural language
|
||||
- 🔄 **Refactoring**: Intelligent code refactoring with AI
|
||||
- 🐛 **Bug Detection**: Find and fix bugs automatically
|
||||
- 📚 **Context Awareness**: Maintains context across editing sessions
|
||||
- 🎯 **Task Orchestration**: Break down and execute complex tasks
|
||||
- 💾 **Local Development**: Runs entirely on your machine
|
||||
This repository provides Nix packages for various AI coding agents, including OpenCode and others, with active maintenance and updates.
|
||||
|
||||
## Installation
|
||||
## What should I use instead?
|
||||
|
||||
### Via Overlay
|
||||
Use the [llm-agents.nix](https://github.com/numtide/llm-agents.nix) flake directly:
|
||||
|
||||
```nix
|
||||
{pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
opencode
|
||||
];
|
||||
}
|
||||
```
|
||||
|
||||
### Direct Reference
|
||||
|
||||
```nix
|
||||
{pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
inputs.m3ta-nixpkgs.packages.${pkgs.system}.opencode
|
||||
];
|
||||
}
|
||||
```
|
||||
|
||||
### Run Directly
|
||||
|
||||
```bash
|
||||
nix run git+https://code.m3ta.dev/m3tam3re/nixpkgs#opencode
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Basic Usage
|
||||
|
||||
```bash
|
||||
# Start OpenCode in current directory
|
||||
opencode
|
||||
|
||||
# Open specific project
|
||||
opencode /path/to/project
|
||||
|
||||
# Start with specific task description
|
||||
opencode "Fix the login bug"
|
||||
|
||||
# Show help
|
||||
opencode --help
|
||||
|
||||
# Show version
|
||||
opencode --version
|
||||
```
|
||||
|
||||
### Interactive Commands
|
||||
|
||||
OpenCode provides an interactive TUI with various commands:
|
||||
|
||||
- **Navigation**: Arrow keys to move, Enter to select
|
||||
- **Search**: `/` to search files, `?` for help
|
||||
- **Edit**: `e` to edit selected file
|
||||
- **Command Palette**: `Ctrl+p` to access commands
|
||||
- **AI Chat**: `Ctrl+c` to open AI chat
|
||||
- **Exit**: `q` or `Ctrl+d` to quit
|
||||
|
||||
### AI Chat Mode
|
||||
|
||||
```bash
|
||||
# Start OpenCode
|
||||
opencode
|
||||
|
||||
# Enter AI chat mode (Ctrl+c)
|
||||
# Ask questions, request code changes, etc.
|
||||
# Examples:
|
||||
# - "Generate a REST API endpoint for user management"
|
||||
# - "Refactor this function to use async/await"
|
||||
# - "Find and fix potential memory leaks"
|
||||
# - "Add unit tests for this module"
|
||||
```
|
||||
|
||||
### Task Management
|
||||
|
||||
```bash
|
||||
# Ask OpenCode to work on a specific task
|
||||
opencode "Implement authentication with JWT tokens"
|
||||
|
||||
# The agent will:
|
||||
# 1. Understand the codebase
|
||||
# 2. Plan the implementation
|
||||
# 3. Generate necessary code
|
||||
# 4. Make the changes
|
||||
# 5. Verify the implementation
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
### Environment Variables
|
||||
|
||||
- `OPENCODE_API_KEY`: API key for LLM provider
|
||||
- `OPENCODE_MODEL`: Default model to use (e.g., gpt-4, claude-3-opus)
|
||||
- `OPENCODE_PROVIDER`: LLM provider (openai, anthropic, etc.)
|
||||
- `OPENCODE_MAX_TOKENS`: Maximum tokens for responses
|
||||
- `OPENCODE_TEMPERATURE`: Sampling temperature (0-1)
|
||||
- `OPENCODE_CONFIG`: Path to configuration file
|
||||
|
||||
### Configuration File
|
||||
|
||||
Create `~/.opencode/config.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"model": "gpt-4",
|
||||
"provider": "openai",
|
||||
"maxTokens": 4096,
|
||||
"temperature": 0.7,
|
||||
"systemPrompt": "You are a helpful coding assistant"
|
||||
inputs = {
|
||||
llm-agents.url = "github:numtide/llm-agents.nix";
|
||||
};
|
||||
|
||||
outputs = { inputs, ... }: {
|
||||
# Access packages via inputs.llm-agents.packages.${system}
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
### Project-Specific Config
|
||||
|
||||
Create `.opencode.json` in your project:
|
||||
|
||||
```json
|
||||
{
|
||||
"include": ["src/**/*.ts", "tests/**/*.ts"],
|
||||
"exclude": ["node_modules", "dist", "*.test.ts"],
|
||||
"systemPrompt": "You are a TypeScript expert"
|
||||
}
|
||||
```
|
||||
|
||||
## Advanced Usage
|
||||
|
||||
### Code Refactoring
|
||||
Or run directly:
|
||||
|
||||
```bash
|
||||
# Ask for refactoring suggestions
|
||||
opencode "Review and refactor src/utils.ts for better performance"
|
||||
|
||||
# Apply refactoring automatically
|
||||
opencode "Optimize the database queries in src/db/*.ts"
|
||||
nix run github:numtide/llm-agents.nix#opencode
|
||||
```
|
||||
|
||||
### Bug Fixing
|
||||
## What about opencode-desktop?
|
||||
|
||||
```bash
|
||||
# Describe the bug
|
||||
opencode "Fix the race condition in the payment processing module"
|
||||
|
||||
# OpenCode will:
|
||||
# 1. Analyze the code
|
||||
# 2. Identify the issue
|
||||
# 3. Propose and implement fixes
|
||||
# 4. Verify the solution
|
||||
```
|
||||
|
||||
### Feature Implementation
|
||||
|
||||
```bash
|
||||
# Request new features
|
||||
opencode "Add support for OAuth2 authentication"
|
||||
|
||||
# Be specific about requirements
|
||||
opencode "Create a REST API with these endpoints: GET /users, POST /users, PUT /users/:id, DELETE /users/:id"
|
||||
```
|
||||
|
||||
### Code Review
|
||||
|
||||
```bash
|
||||
# Get code review
|
||||
opencode "Review src/api/*.ts for security vulnerabilities"
|
||||
|
||||
# Check for best practices
|
||||
opencode "Review the entire codebase and suggest improvements following SOLID principles"
|
||||
```
|
||||
|
||||
### Documentation Generation
|
||||
|
||||
```bash
|
||||
# Generate documentation
|
||||
opencode "Add JSDoc comments to all functions in src/utils.ts"
|
||||
|
||||
# Create README
|
||||
opencode "Generate a comprehensive README.md for this project"
|
||||
```
|
||||
|
||||
## Integration with Editors
|
||||
|
||||
### VS Code
|
||||
|
||||
OpenCode can work alongside your editor:
|
||||
|
||||
```bash
|
||||
# Keep VS Code running for editing
|
||||
code .
|
||||
|
||||
# Use OpenCode for AI assistance in another terminal
|
||||
opencode
|
||||
|
||||
# Switch between them as needed
|
||||
```
|
||||
|
||||
### Vim/Neovim
|
||||
|
||||
```bash
|
||||
# Use Vim/Neovim as your editor
|
||||
vim src/main.ts
|
||||
|
||||
# Use OpenCode for complex tasks
|
||||
opencode "Refactor the authentication module"
|
||||
```
|
||||
|
||||
## Use Cases
|
||||
|
||||
### Learning New Codebases
|
||||
|
||||
```bash
|
||||
# OpenCode will:
|
||||
# 1. Analyze the code structure
|
||||
# 2. Explain how components work
|
||||
# 3. Answer questions about the code
|
||||
opencode "Explain how this project handles user authentication"
|
||||
```
|
||||
|
||||
### Porting Code
|
||||
|
||||
```bash
|
||||
# Port from one language to another
|
||||
opencode "Port this Python function to TypeScript"
|
||||
```
|
||||
|
||||
### Writing Tests
|
||||
|
||||
```bash
|
||||
# Generate unit tests
|
||||
opencode "Add comprehensive unit tests for src/utils.ts with 100% coverage"
|
||||
```
|
||||
|
||||
### Debugging
|
||||
|
||||
```bash
|
||||
# Get help with debugging
|
||||
opencode "I'm getting a null pointer exception in src/api/users.ts. Help me debug it"
|
||||
```
|
||||
|
||||
## Keyboard Shortcuts
|
||||
|
||||
### Global
|
||||
|
||||
- `Ctrl+p` - Open command palette
|
||||
- `Ctrl+c` - Open AI chat
|
||||
- `Ctrl+s` - Save current file
|
||||
- `Ctrl+q` - Quit
|
||||
- `?` - Show help
|
||||
|
||||
### Navigation
|
||||
|
||||
- `j` / `k` - Down / Up
|
||||
- `h` / `l` - Left / Right
|
||||
- `gg` - Go to top
|
||||
- `G` - Go to bottom
|
||||
- `/` - Search
|
||||
- `n` - Next search result
|
||||
- `N` - Previous search result
|
||||
|
||||
### File Operations
|
||||
|
||||
- `e` - Edit file
|
||||
- `o` - Open in external editor
|
||||
- `d` - Delete file (with confirmation)
|
||||
- `y` - Yank (copy)
|
||||
- `p` - Paste
|
||||
|
||||
## Build Information
|
||||
|
||||
- **Version**: 1.1.18
|
||||
- **Language**: TypeScript/JavaScript (core), Go (TUI)
|
||||
- **Runtime**: Bun
|
||||
- **License**: MIT
|
||||
- **Source**: [GitHub](https://github.com/anomalyco/opencode)
|
||||
|
||||
## Dependencies
|
||||
|
||||
- `bun` - JavaScript runtime and package manager
|
||||
- `fzf` - Fuzzy finder for file selection
|
||||
- `ripgrep` - Fast text search
|
||||
- `models-dev` - Model definitions and schemas
|
||||
|
||||
## Platform Support
|
||||
|
||||
- Linux (aarch64, x86_64)
|
||||
- macOS (aarch64, x86_64)
|
||||
|
||||
## Notes
|
||||
|
||||
- Includes a patch to relax Bun version check (changed to warning instead of error)
|
||||
- Shell completions are installed for supported platforms (excludes x86_64-darwin)
|
||||
- Tree-sitter WASM files are patched to use absolute store paths
|
||||
- JSON schema is generated and installed to `$out/share/opencode/schema.json`
|
||||
|
||||
## Tips and Best Practices
|
||||
|
||||
### Getting Started
|
||||
|
||||
1. **Start Small**: Begin with simple tasks to get familiar with the interface
|
||||
2. **Provide Context**: Give clear, detailed descriptions of what you want
|
||||
3. **Iterate**: Work with OpenCode iteratively, refining requests as needed
|
||||
4. **Review Changes**: Always review AI-generated code before committing
|
||||
|
||||
### Effective Prompts
|
||||
|
||||
- Be specific about requirements
|
||||
- Provide examples of expected behavior
|
||||
- Mention constraints or preferences
|
||||
- Break complex tasks into smaller steps
|
||||
|
||||
### Project Structure
|
||||
|
||||
- Keep your project well-organized
|
||||
- Use consistent naming conventions
|
||||
- Add clear comments to complex logic
|
||||
- Maintain a clean git history
|
||||
|
||||
## Related
|
||||
|
||||
- [Adding Packages](../guides/adding-packages.md) - How to add new packages
|
||||
- [Quick Start](../QUICKSTART.md) - Getting started guide
|
||||
- [OpenCode Documentation](https://github.com/anomalyco/opencode) - Official repository and documentation
|
||||
The `opencode-desktop` package remains available in this repository as it includes a Wayland support workaround for [upstream issue #11755](https://github.com/opencode-ai/opencode/issues/11755). Once this issue is resolved upstream, `opencode-desktop` may also be removed in favor of the llm-agents.nix repository.
|
||||
|
||||
134
docs/packages/sidecar.md
Normal file
134
docs/packages/sidecar.md
Normal file
@@ -0,0 +1,134 @@
|
||||
# sidecar
|
||||
|
||||
A companion tool for CLI coding agents, providing diffs, file trees, conversation history, and task management with td integration.
|
||||
|
||||
## Description
|
||||
|
||||
sidecar is a terminal UI tool designed to enhance the experience of using AI coding agents in the terminal. It provides a side panel interface for viewing diffs, file trees, conversation history, and integrates with `td` for task management across coding sessions.
|
||||
|
||||
## Features
|
||||
|
||||
- 🔀 **Diff Viewer**: Visual diff display for code changes
|
||||
- 📁 **File Tree**: Navigate and understand project structure
|
||||
- 💬 **Conversation History**: Review and search past AI interactions
|
||||
- ✅ **Task Management**: Integrated with `td` for tracking tasks
|
||||
- 🖥️ **Terminal UI**: Clean interface using tmux panes
|
||||
- 🤖 **AI Agent Integration**: Designed to work with opencode and similar CLI agents
|
||||
|
||||
## Installation
|
||||
|
||||
### Via Overlay
|
||||
|
||||
```nix
|
||||
{pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
sidecar
|
||||
];
|
||||
}
|
||||
```
|
||||
|
||||
### Direct Reference
|
||||
|
||||
```nix
|
||||
{pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
inputs.m3ta-nixpkgs.packages.${pkgs.system}.sidecar
|
||||
];
|
||||
}
|
||||
```
|
||||
|
||||
### Run Directly
|
||||
|
||||
```bash
|
||||
nix run git+https://code.m3ta.dev/m3tam3re/nixpkgs#sidecar
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Starting sidecar
|
||||
|
||||
```bash
|
||||
# Start sidecar alongside your AI coding agent
|
||||
sidecar
|
||||
|
||||
# Start with a specific agent
|
||||
sidecar --agent opencode
|
||||
```
|
||||
|
||||
### Basic Commands
|
||||
|
||||
```bash
|
||||
# Show help
|
||||
sidecar --help
|
||||
|
||||
# Check version
|
||||
sidecar --version
|
||||
```
|
||||
|
||||
## Dependencies
|
||||
|
||||
sidecar is packaged with the following runtime dependencies:
|
||||
|
||||
- **opencode**: AI coding agent
|
||||
- **td**: Task tracking CLI
|
||||
- **tmux**: Terminal multiplexer for UI layout
|
||||
|
||||
These are automatically included in the PATH when running sidecar.
|
||||
|
||||
## Workflow Integration
|
||||
|
||||
### Typical Session
|
||||
|
||||
1. Start `sidecar` in your project directory
|
||||
2. The tool opens a tmux session with panes for:
|
||||
- Your AI coding agent (opencode)
|
||||
- Task list (via td)
|
||||
- Diff viewer
|
||||
- File tree navigator
|
||||
3. Work with your AI agent as usual
|
||||
4. View diffs and changes in real-time
|
||||
5. Track tasks using the integrated td panel
|
||||
|
||||
### With opencode
|
||||
|
||||
```bash
|
||||
# sidecar automatically integrates with opencode
|
||||
cd your-project
|
||||
sidecar
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
### Environment Variables
|
||||
|
||||
- `SIDECAR_CONFIG`: Custom configuration file path
|
||||
- `SIDECAR_AGENT`: Default AI agent to use (default: opencode)
|
||||
|
||||
### Customization
|
||||
|
||||
Configuration is managed through sidecar's own config system. See the upstream documentation for details.
|
||||
|
||||
## Build Information
|
||||
|
||||
- **Version**: 0.71.1
|
||||
- **Language**: Go
|
||||
- **License**: MIT
|
||||
- **Source**: [GitHub](https://github.com/marcus/sidecar)
|
||||
|
||||
## Platform Support
|
||||
|
||||
- Linux
|
||||
- macOS (Unix systems)
|
||||
|
||||
## Notes
|
||||
|
||||
- Tests are disabled in the Nix package build
|
||||
- The package wraps the binary with required dependencies (opencode, td, tmux) in PATH
|
||||
- Version check is enabled for the Nix package
|
||||
|
||||
## Related
|
||||
|
||||
- [td](./td.md) - Task tracking CLI used by sidecar
|
||||
- [opencode](./opencode.md) - AI coding agent integration
|
||||
- [Adding Packages](../guides/adding-packages.md) - How to add new packages
|
||||
- [Quick Start](../QUICKSTART.md) - Getting started guide
|
||||
130
docs/packages/td.md
Normal file
130
docs/packages/td.md
Normal file
@@ -0,0 +1,130 @@
|
||||
# td
|
||||
|
||||
Minimalist CLI for tracking tasks across AI coding sessions.
|
||||
|
||||
## Description
|
||||
|
||||
td (task daemon) is a lightweight command-line tool designed for tracking tasks during AI-assisted coding sessions. It provides a simple, fast way to manage todos and maintain context across conversations with AI coding agents.
|
||||
|
||||
## Features
|
||||
|
||||
- ✅ **Minimal Task Tracking**: Simple, focused task management
|
||||
- 🤖 **AI Session Aware**: Designed to work with AI coding workflows
|
||||
- 📊 **Usage Tracking**: Track session usage and context
|
||||
- 🔄 **Session Continuity**: Resume tasks from previous sessions
|
||||
- 📝 **Git Integration**: Works alongside git workflows
|
||||
- ⚡ **Fast**: Lightweight Go binary with minimal overhead
|
||||
|
||||
## Installation
|
||||
|
||||
### Via Overlay
|
||||
|
||||
```nix
|
||||
{pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
td
|
||||
];
|
||||
}
|
||||
```
|
||||
|
||||
### Direct Reference
|
||||
|
||||
```nix
|
||||
{pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
inputs.m3ta-nixpkgs.packages.${pkgs.system}.td
|
||||
];
|
||||
}
|
||||
```
|
||||
|
||||
### Run Directly
|
||||
|
||||
```bash
|
||||
nix run git+https://code.m3ta.dev/m3tam3re/nixpkgs#td
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Starting a Session
|
||||
|
||||
```bash
|
||||
# Start a new session and view current tasks
|
||||
td usage --new-session
|
||||
|
||||
# Quick view of current tasks (no session tracking)
|
||||
td usage -q
|
||||
```
|
||||
|
||||
### Basic Commands
|
||||
|
||||
```bash
|
||||
# Show version
|
||||
td version
|
||||
|
||||
# View help
|
||||
td --help
|
||||
```
|
||||
|
||||
### Task Management
|
||||
|
||||
td integrates with AI coding workflows to track tasks across sessions. Use it at the start of conversations to establish context:
|
||||
|
||||
```bash
|
||||
# At conversation start (or after /clear)
|
||||
td usage --new-session
|
||||
|
||||
# For subsequent reads within the same session
|
||||
td usage -q
|
||||
```
|
||||
|
||||
## Integration with AI Agents
|
||||
|
||||
td is designed to be used by AI coding agents as part of their workflow:
|
||||
|
||||
1. **Session Start**: Agent reads current tasks with `td usage --new-session`
|
||||
2. **Work Progress**: Tasks are tracked and updated during the session
|
||||
3. **Session End**: State is preserved for the next session
|
||||
|
||||
### Example Integration
|
||||
|
||||
In an AI agent's system prompt or configuration:
|
||||
|
||||
```
|
||||
You must run td usage --new-session at conversation start (or after /clear) to see current work.
|
||||
Use td usage -q for subsequent reads.
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
### Environment Variables
|
||||
|
||||
- `TD_DATA_DIR`: Custom directory for td data storage
|
||||
|
||||
### Data Storage
|
||||
|
||||
Task data is stored locally in the project or user directory. See upstream documentation for exact storage location.
|
||||
|
||||
## Build Information
|
||||
|
||||
- **Version**: 0.34.0
|
||||
- **Language**: Go
|
||||
- **License**: MIT
|
||||
- **Source**: [GitHub](https://github.com/marcus/td)
|
||||
|
||||
## Platform Support
|
||||
|
||||
- Linux
|
||||
- macOS (Unix systems)
|
||||
|
||||
## Notes
|
||||
|
||||
- Tests are disabled in the Nix package build due to git worktree operations
|
||||
- Version check is enabled for the Nix package (`td version`)
|
||||
- Minimal dependencies - pure Go binary
|
||||
|
||||
## Related
|
||||
|
||||
- [sidecar](./sidecar.md) - Uses td for integrated task management
|
||||
- [opencode](./opencode.md) - AI coding agent that integrates with td
|
||||
- [Adding Packages](../guides/adding-packages.md) - How to add new packages
|
||||
- [Quick Start](../QUICKSTART.md) - Getting started guide
|
||||
43
flake.lock
generated
43
flake.lock
generated
@@ -2,11 +2,11 @@
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1770562336,
|
||||
"narHash": "sha256-ub1gpAONMFsT/GU2hV6ZWJjur8rJ6kKxdm9IlCT0j84=",
|
||||
"lastModified": 1772963539,
|
||||
"narHash": "sha256-9jVDGZnvCckTGdYT53d/EfznygLskyLQXYwJLKMPsZs=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "d6c71932130818840fc8fe9509cf50be8c64634f",
|
||||
"rev": "9dcb002ca1690658be4a04645215baea8b95f31d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -18,11 +18,11 @@
|
||||
},
|
||||
"nixpkgs-master": {
|
||||
"locked": {
|
||||
"lastModified": 1770917518,
|
||||
"narHash": "sha256-XSwv/tVrNo/L8SPH8Lx9xZH1PrZd/3Z3J/0SH7Xertg=",
|
||||
"lastModified": 1773150927,
|
||||
"narHash": "sha256-0Js8/ZxXH575nfmUENgX2JlFY6GrXjFTlQT81mfN1bQ=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "3f4a3c08f2f318ee29fc8a2689f390071a94aaf0",
|
||||
"rev": "2d82c4ce7238cc3e5bf80ba48894185ea3947615",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -39,25 +39,46 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1770875904,
|
||||
"narHash": "sha256-8ZEVlGe1saA/2KtDTKgkwWfpLCbxfwFip+m+3FlQQK0=",
|
||||
"lastModified": 1773072574,
|
||||
"narHash": "sha256-smGIc6lYWSjfmGAikoYpP7GbB6mWacrPWrRtp/+HJ3E=",
|
||||
"owner": "anomalyco",
|
||||
"repo": "opencode",
|
||||
"rev": "03de51bd3cf9e05bd92c9f51763b74a3cdfbe61a",
|
||||
"rev": "c6262f9d4002d86a1f1795c306aa329d45361d12",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "anomalyco",
|
||||
"ref": "v1.1.60",
|
||||
"ref": "v1.2.24",
|
||||
"repo": "opencode",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"openspec": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1772182342,
|
||||
"narHash": "sha256-9Q0iUyZGcDPLdgvnrBN3GumV8g9akV8TFb8bFkD1yYs=",
|
||||
"owner": "Fission-AI",
|
||||
"repo": "OpenSpec",
|
||||
"rev": "afdca0d5dab1aa109cfd8848b2512333ccad60c3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "Fission-AI",
|
||||
"repo": "OpenSpec",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs-master": "nixpkgs-master",
|
||||
"opencode": "opencode"
|
||||
"opencode": "opencode",
|
||||
"openspec": "openspec"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
185
flake.nix
185
flake.nix
@@ -1,6 +1,5 @@
|
||||
{
|
||||
description =
|
||||
"m3ta's personal Nix repository - Custom packages, overlays, and modules";
|
||||
description = "m3ta's personal Nix repository - Custom packages, overlays, and modules";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
@@ -8,95 +7,119 @@
|
||||
|
||||
# opencode needs newer bun from master
|
||||
opencode = {
|
||||
url = "github:anomalyco/opencode/v1.1.60";
|
||||
url = "github:anomalyco/opencode/v1.2.24";
|
||||
inputs.nixpkgs.follows = "nixpkgs-master";
|
||||
};
|
||||
|
||||
# openspec - spec-driven development for AI coding assistants
|
||||
openspec = {
|
||||
url = "github:Fission-AI/OpenSpec";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, ... }@inputs:
|
||||
let
|
||||
# Supported systems
|
||||
systems =
|
||||
[ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
...
|
||||
} @ inputs: let
|
||||
# Supported systems
|
||||
systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
|
||||
|
||||
# Helper function to generate an attrset for each of the systems
|
||||
forAllSystems = nixpkgs.lib.genAttrs systems;
|
||||
# Helper function to generate an attrset for each of the systems
|
||||
forAllSystems = nixpkgs.lib.genAttrs systems;
|
||||
|
||||
# Helper to create pkgs for a given system
|
||||
pkgsFor = system:
|
||||
import nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
in {
|
||||
# Custom packages - accessible via 'nix build .#package-name'
|
||||
packages = forAllSystems (system:
|
||||
let pkgs = pkgsFor system;
|
||||
in import ./pkgs { inherit pkgs inputs; });
|
||||
|
||||
# Overlays - can be imported in your system configuration
|
||||
overlays = {
|
||||
# Default overlay: adds all custom packages
|
||||
default = final: prev:
|
||||
import ./pkgs {
|
||||
pkgs = final;
|
||||
inputs = inputs;
|
||||
};
|
||||
|
||||
# Individual overlays for more granular control
|
||||
additions = final: prev:
|
||||
import ./pkgs {
|
||||
pkgs = final;
|
||||
inputs = inputs;
|
||||
};
|
||||
|
||||
modifications = final: prev: import ./overlays/mods { inherit prev; };
|
||||
# Helper to create pkgs for a given system
|
||||
pkgsFor = system:
|
||||
import nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
in {
|
||||
# Custom packages - accessible via 'nix build .#package-name'
|
||||
packages = forAllSystems (system: let
|
||||
pkgs = pkgsFor system;
|
||||
in
|
||||
import ./pkgs {inherit pkgs inputs;});
|
||||
|
||||
# NixOS modules - for system-level configuration
|
||||
nixosModules = {
|
||||
default = ./modules/nixos;
|
||||
# Individual modules for selective imports
|
||||
ports = ./modules/nixos/ports.nix;
|
||||
mem0 = ./modules/nixos/mem0.nix;
|
||||
# Overlays - can be imported in your system configuration
|
||||
overlays = {
|
||||
# Default overlay: adds all custom packages
|
||||
default = final: prev:
|
||||
import ./pkgs {
|
||||
pkgs = final;
|
||||
inputs = inputs;
|
||||
};
|
||||
|
||||
# Individual overlays for more granular control
|
||||
additions = final: prev:
|
||||
import ./pkgs {
|
||||
pkgs = final;
|
||||
inputs = inputs;
|
||||
};
|
||||
|
||||
modifications = final: prev: import ./overlays/mods {inherit prev;};
|
||||
};
|
||||
|
||||
# NixOS modules - for system-level configuration
|
||||
nixosModules = {
|
||||
default = ./modules/nixos;
|
||||
# Individual modules for selective imports
|
||||
ports = ./modules/nixos/ports.nix;
|
||||
mem0 = ./modules/nixos/mem0.nix;
|
||||
};
|
||||
|
||||
# Home Manager modules - for user-level configuration
|
||||
homeManagerModules = {
|
||||
default = import ./modules/home-manager;
|
||||
ports = import ./modules/home-manager/ports.nix;
|
||||
zellij-ps = import ./modules/home-manager/zellij-ps.nix;
|
||||
};
|
||||
|
||||
# Library functions - helper utilities for your configuration
|
||||
lib = forAllSystems (system: let
|
||||
pkgs = pkgsFor system;
|
||||
in
|
||||
import ./lib {lib = pkgs.lib;});
|
||||
|
||||
# Development shells for various programming environments
|
||||
# Usage: nix develop .#<shell-name>
|
||||
# Available shells: default, python, devops, opencode
|
||||
devShells = forAllSystems (system: let
|
||||
pkgs = pkgsFor system;
|
||||
in
|
||||
import ./shells {inherit pkgs inputs;});
|
||||
|
||||
# Formatter for 'nix fmt'
|
||||
formatter = forAllSystems (system: (pkgsFor system).alejandra);
|
||||
|
||||
# Checks for 'nix flake check' - verifies all packages build
|
||||
checks = forAllSystems (system: let
|
||||
pkgs = pkgsFor system;
|
||||
packages = import ./pkgs {inherit pkgs inputs;};
|
||||
in
|
||||
builtins.mapAttrs (name: pkg: pkgs.lib.hydraJob pkg) packages
|
||||
// {
|
||||
formatting = pkgs.runCommand "check-formatting" {} ''
|
||||
${pkgs.alejandra}/bin/alejandra --check ${./.}
|
||||
touch $out
|
||||
'';
|
||||
});
|
||||
|
||||
# Templates for creating new packages/modules
|
||||
templates = {
|
||||
package = {
|
||||
path = ./templates/package;
|
||||
description = "Template for a new package";
|
||||
};
|
||||
|
||||
# Home Manager modules - for user-level configuration
|
||||
homeManagerModules = {
|
||||
default = import ./modules/home-manager;
|
||||
ports = import ./modules/home-manager/ports.nix;
|
||||
zellij-ps = import ./modules/home-manager/zellij-ps.nix;
|
||||
nixos-module = {
|
||||
path = ./templates/nixos-module;
|
||||
description = "Template for a new NixOS module";
|
||||
};
|
||||
|
||||
# Library functions - helper utilities for your configuration
|
||||
lib = forAllSystems (system:
|
||||
let pkgs = pkgsFor system;
|
||||
in import ./lib { lib = pkgs.lib; });
|
||||
|
||||
# Development shells for various programming environments
|
||||
# Usage: nix develop .#<shell-name>
|
||||
# Available shells: default, python, devops
|
||||
devShells = forAllSystems (system:
|
||||
let pkgs = pkgsFor system;
|
||||
in import ./shells { inherit pkgs; });
|
||||
|
||||
# Formatter for 'nix fmt'
|
||||
formatter = forAllSystems (system: (pkgsFor system).alejandra);
|
||||
|
||||
# Templates for creating new packages/modules
|
||||
templates = {
|
||||
package = {
|
||||
path = ./templates/package;
|
||||
description = "Template for a new package";
|
||||
};
|
||||
nixos-module = {
|
||||
path = ./templates/nixos-module;
|
||||
description = "Template for a new NixOS module";
|
||||
};
|
||||
home-manager-module = {
|
||||
path = ./templates/home-manager-module;
|
||||
description = "Template for a new Home Manager module";
|
||||
};
|
||||
home-manager-module = {
|
||||
path = ./templates/home-manager-module;
|
||||
description = "Template for a new Home Manager module";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -7,6 +7,6 @@
|
||||
# Port management utilities
|
||||
ports = import ./ports.nix {inherit lib;};
|
||||
|
||||
# Add more helper modules here as needed
|
||||
# example = import ./example.nix { inherit lib; };
|
||||
# OpenCode rules injection utilities
|
||||
opencode-rules = import ./opencode-rules.nix {inherit lib;};
|
||||
}
|
||||
|
||||
116
lib/opencode-rules.nix
Normal file
116
lib/opencode-rules.nix
Normal file
@@ -0,0 +1,116 @@
|
||||
# Opencode rules management utilities
|
||||
#
|
||||
# This module provides functions to configure Opencode agent rules across
|
||||
# multiple projects. Rules are defined in the AGENTS repository and can be
|
||||
# selectively included based on language, framework, and concerns.
|
||||
#
|
||||
# Usage in your configuration:
|
||||
#
|
||||
# # In your flake or configuration:
|
||||
# let
|
||||
# m3taLib = inputs.m3ta-nixpkgs.lib.${system};
|
||||
#
|
||||
# rules = m3taLib.opencode-rules.mkOpencodeRules {
|
||||
# agents = inputs.agents;
|
||||
# languages = [ "python" "typescript" ];
|
||||
# concerns = [ "coding-style" "naming" "documentation" ];
|
||||
# frameworks = [ "react" "fastapi" ];
|
||||
# };
|
||||
# in {
|
||||
# # Use in your devShell:
|
||||
# devShells.default = pkgs.mkShell {
|
||||
# shellHook = rules.shellHook;
|
||||
# inherit (rules) instructions;
|
||||
# };
|
||||
# }
|
||||
#
|
||||
# The shellHook creates:
|
||||
# - A `.opencode-rules/` symlink pointing to the AGENTS repository rules directory
|
||||
# - An `opencode.json` file with a $schema reference and instructions list
|
||||
#
|
||||
# The instructions list contains paths relative to the project root, all prefixed
|
||||
# with `.opencode-rules/`, making them portable across different project locations.
|
||||
{lib}: {
|
||||
# Create Opencode rules configuration from AGENTS repository
|
||||
#
|
||||
# Args:
|
||||
# agents: Path to the AGENTS repository (non-flake input)
|
||||
# languages: Optional list of language-specific rules to include
|
||||
# (e.g., [ "python" "typescript" "rust" ])
|
||||
# concerns: Optional list of concern rules to include
|
||||
# Default: [ "coding-style" "naming" "documentation" "testing" "git-workflow" "project-structure" ]
|
||||
# frameworks: Optional list of framework-specific rules to include
|
||||
# (e.g., [ "react" "fastapi" "django" ])
|
||||
# extraInstructions: Optional list of additional instruction paths
|
||||
# (for custom rules outside standard locations)
|
||||
#
|
||||
# Returns:
|
||||
# An attribute set containing:
|
||||
# - shellHook: Bash code to create symlink and opencode.json
|
||||
# - instructions: List of rule file paths (relative to project root)
|
||||
#
|
||||
# Example:
|
||||
# mkOpencodeRules {
|
||||
# agents = inputs.agents;
|
||||
# languages = [ "python" ];
|
||||
# frameworks = [ "fastapi" ];
|
||||
# }
|
||||
# # Returns:
|
||||
# # {
|
||||
# # shellHook = "...";
|
||||
# # instructions = [
|
||||
# # ".opencode-rules/concerns/coding-style.md"
|
||||
# # ".opencode-rules/concerns/naming.md"
|
||||
# # ".opencode-rules/concerns/documentation.md"
|
||||
# # ".opencode-rules/concerns/testing.md"
|
||||
# # ".opencode-rules/concerns/git-workflow.md"
|
||||
# # ".opencode-rules/concerns/project-structure.md"
|
||||
# # ".opencode-rules/languages/python.md"
|
||||
# # ".opencode-rules/frameworks/fastapi.md"
|
||||
# # ];
|
||||
# # }
|
||||
mkOpencodeRules = {
|
||||
agents,
|
||||
languages ? [],
|
||||
concerns ? [
|
||||
"coding-style"
|
||||
"naming"
|
||||
"documentation"
|
||||
"testing"
|
||||
"git-workflow"
|
||||
"project-structure"
|
||||
],
|
||||
frameworks ? [],
|
||||
extraInstructions ? [],
|
||||
}: let
|
||||
rulesDir = ".opencode-rules";
|
||||
|
||||
# Build instructions list by mapping concerns, languages, frameworks to their file paths
|
||||
# All paths are relative to project root via the rulesDir symlink
|
||||
instructions =
|
||||
(map (c: "${rulesDir}/concerns/${c}.md") concerns)
|
||||
++ (map (l: "${rulesDir}/languages/${l}.md") languages)
|
||||
++ (map (f: "${rulesDir}/frameworks/${f}.md") frameworks)
|
||||
++ extraInstructions;
|
||||
|
||||
# Generate JSON configuration for Opencode
|
||||
opencodeConfig = {
|
||||
"$schema" = "https://opencode.ai/config.json";
|
||||
inherit instructions;
|
||||
};
|
||||
in {
|
||||
inherit instructions;
|
||||
|
||||
# Shell hook to set up rules in the project
|
||||
# Creates a symlink to the AGENTS rules directory and generates opencode.json
|
||||
shellHook = ''
|
||||
# Create/update symlink to AGENTS rules directory
|
||||
ln -sfn ${agents}/rules ${rulesDir}
|
||||
|
||||
# Generate opencode.json configuration file
|
||||
cat > opencode.json <<'OPENCODE_EOF'
|
||||
${builtins.toJSON opencodeConfig}
|
||||
OPENCODE_EOF
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
gitMinimal,
|
||||
installShellFiles,
|
||||
nix-update-script,
|
||||
versionCheckHook,
|
||||
writableTmpDirAsHomeHook,
|
||||
}:
|
||||
buildGoModule (finalAttrs: {
|
||||
pname = "beads";
|
||||
version = "0.49.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "steveyegge";
|
||||
repo = "beads";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-roOyTMy9nKxH2Bk8MnP4h2CDjStwK6z0ThQhFcM64QI=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-YU+bRLVlWtHzJ1QPzcKJ70f+ynp8lMoIeFlm+29BNPE=";
|
||||
|
||||
subPackages = ["cmd/bd"];
|
||||
|
||||
ldflags = ["-s" "-w"];
|
||||
|
||||
nativeBuildInputs = [installShellFiles];
|
||||
|
||||
nativeCheckInputs = [gitMinimal writableTmpDirAsHomeHook];
|
||||
|
||||
# Skip security tests on Darwin - they check for /etc/passwd which isn't available in sandbox
|
||||
checkFlags =
|
||||
lib.optionals stdenv.hostPlatform.isDarwin
|
||||
["-skip=TestCleanupMergeArtifacts_CommandInjectionPrevention"];
|
||||
|
||||
preCheck = ''
|
||||
export PATH="$out/bin:$PATH"
|
||||
'';
|
||||
|
||||
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||
installShellCompletion --cmd bd \
|
||||
--bash <($out/bin/bd completion bash) \
|
||||
--fish <($out/bin/bd completion fish) \
|
||||
--zsh <($out/bin/bd completion zsh)
|
||||
'';
|
||||
|
||||
nativeInstallCheckInputs = [versionCheckHook writableTmpDirAsHomeHook];
|
||||
versionCheckProgramArg = "version";
|
||||
doInstallCheck = true;
|
||||
|
||||
doCheck = false;
|
||||
|
||||
passthru.updateScript = nix-update-script {};
|
||||
|
||||
meta = {
|
||||
description = "Lightweight memory system for AI coding agents with graph-based issue tracking";
|
||||
homepage = "https://github.com/steveyegge/beads";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [kedry];
|
||||
mainProgram = "bd";
|
||||
};
|
||||
})
|
||||
@@ -1,22 +1,25 @@
|
||||
{ pkgs, inputs ? null, ... }: {
|
||||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
# Custom packages registry
|
||||
# Each package is defined in its own directory under pkgs/
|
||||
beads = pkgs.callPackage ./beads { };
|
||||
sidecar = pkgs.callPackage ./sidecar { };
|
||||
td = pkgs.callPackage ./td { };
|
||||
code2prompt = pkgs.callPackage ./code2prompt { };
|
||||
hyprpaper-random = pkgs.callPackage ./hyprpaper-random { };
|
||||
launch-webapp = pkgs.callPackage ./launch-webapp { };
|
||||
mem0 = pkgs.callPackage ./mem0 { };
|
||||
msty-studio = pkgs.callPackage ./msty-studio { };
|
||||
n8n = pkgs.callPackage ./n8n { };
|
||||
pomodoro-timer = pkgs.callPackage ./pomodoro-timer { };
|
||||
rofi-project-opener = pkgs.callPackage ./rofi-project-opener { };
|
||||
stt-ptt = pkgs.callPackage ./stt-ptt { };
|
||||
tuxedo-backlight = pkgs.callPackage ./tuxedo-backlight { };
|
||||
zellij-ps = pkgs.callPackage ./zellij-ps { };
|
||||
sidecar = pkgs.callPackage ./sidecar {};
|
||||
td = pkgs.callPackage ./td {};
|
||||
code2prompt = pkgs.callPackage ./code2prompt {};
|
||||
hyprpaper-random = pkgs.callPackage ./hyprpaper-random {};
|
||||
launch-webapp = pkgs.callPackage ./launch-webapp {};
|
||||
mem0 = pkgs.callPackage ./mem0 {};
|
||||
msty-studio = pkgs.callPackage ./msty-studio {};
|
||||
notesmd-cli = pkgs.callPackage ./notesmd-cli {};
|
||||
n8n = pkgs.callPackage ./n8n {};
|
||||
pomodoro-timer = pkgs.callPackage ./pomodoro-timer {};
|
||||
rofi-project-opener = pkgs.callPackage ./rofi-project-opener {};
|
||||
stt-ptt = pkgs.callPackage ./stt-ptt {};
|
||||
tuxedo-backlight = pkgs.callPackage ./tuxedo-backlight {};
|
||||
zellij-ps = pkgs.callPackage ./zellij-ps {};
|
||||
|
||||
# Imported from flake inputs
|
||||
opencode = inputs.opencode.packages.${pkgs.system}.opencode;
|
||||
opencode-desktop = pkgs.callPackage ./opencode-desktop { inherit inputs; };
|
||||
opencode-desktop = pkgs.callPackage ./opencode-desktop {inherit inputs;};
|
||||
}
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
}:
|
||||
python3.pkgs.buildPythonPackage rec {
|
||||
pname = "mem0ai";
|
||||
version = "1.0.3";
|
||||
version = "1.0.5";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "mem0ai";
|
||||
repo = "mem0";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-OIiInnXSE4Q+d+Hwb/cPD29aCYNQjPDshPVv/MsLy5Y=";
|
||||
hash = "sha256-UGmDNCsvDPyAKfqo9BPP9ISnYkcNSJ5FS9mh3kAyo0M=";
|
||||
};
|
||||
|
||||
# Relax Python dependency version constraints
|
||||
|
||||
@@ -15,100 +15,113 @@
|
||||
libmongocrypt,
|
||||
libpq,
|
||||
makeWrapper,
|
||||
}:
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "n8n";
|
||||
version = "n8n@2.7.4";
|
||||
}: let
|
||||
python = python3.withPackages (ps: with ps; [websockets]);
|
||||
in
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "n8n";
|
||||
version = "2.9.4";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "n8n-io";
|
||||
repo = "n8n";
|
||||
tag = finalAttrs.version;
|
||||
hash = "sha256-liRB5BO738gvEpAsDaK632w38S0cDkI9DWnTLaEf0E0=";
|
||||
};
|
||||
src = fetchFromGitHub {
|
||||
owner = "n8n-io";
|
||||
repo = "n8n";
|
||||
tag = "n8n@${finalAttrs.version}";
|
||||
hash = "sha256-XXQPZHtY66gOQ+nYH+Q1IjbR+SRZ9g06sgBy2x8gGh4=";
|
||||
};
|
||||
|
||||
pnpmDeps = fetchPnpmDeps {
|
||||
inherit (finalAttrs) pname version src;
|
||||
pnpm = pnpm_10;
|
||||
fetcherVersion = 3;
|
||||
hash = "sha256-s6l049slBJCP6qCgY/uLNuIVDNuUmiTUX94sKDi+86g=";
|
||||
};
|
||||
pnpmDeps = fetchPnpmDeps {
|
||||
inherit (finalAttrs) pname version src;
|
||||
pnpm = pnpm_10;
|
||||
fetcherVersion = 3;
|
||||
hash = "sha256-TU7HIShYj20QtdcthP0nQdubYl0bdy+XM3CoX5Rvhzk=";
|
||||
};
|
||||
|
||||
nativeBuildInputs =
|
||||
[
|
||||
pnpmConfigHook
|
||||
pnpm_10
|
||||
python3 # required to build sqlite3 bindings
|
||||
node-gyp # required to build sqlite3 bindings
|
||||
makeWrapper
|
||||
]
|
||||
++ lib.optional stdenv.hostPlatform.isDarwin [cctools xcbuild];
|
||||
nativeBuildInputs =
|
||||
[
|
||||
pnpmConfigHook
|
||||
pnpm_10
|
||||
python3 # required to build sqlite3 bindings
|
||||
node-gyp # required to build sqlite3 bindings
|
||||
makeWrapper
|
||||
]
|
||||
++ lib.optional stdenv.hostPlatform.isDarwin [cctools xcbuild];
|
||||
|
||||
buildInputs = [nodejs libkrb5 libmongocrypt libpq];
|
||||
buildInputs = [nodejs libkrb5 libmongocrypt libpq];
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
pushd node_modules/sqlite3
|
||||
node-gyp rebuild
|
||||
popd
|
||||
pushd node_modules/sqlite3
|
||||
node-gyp rebuild
|
||||
popd
|
||||
|
||||
# TODO: use deploy after resolved https://github.com/pnpm/pnpm/issues/5315
|
||||
pnpm build --filter=n8n
|
||||
# TODO: use deploy after resolved https://github.com/pnpm/pnpm/issues/5315
|
||||
pnpm build --filter=n8n
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
preInstall = ''
|
||||
echo "Removing non-deterministic and unnecessary files"
|
||||
|
||||
find -type d -name .turbo -exec rm -rf {} +
|
||||
rm node_modules/.modules.yaml
|
||||
rm packages/nodes-base/dist/types/nodes.json
|
||||
|
||||
CI=true pnpm --ignore-scripts prune --prod
|
||||
find -type f \( -name "*.ts" -o -name "*.map" \) -exec rm -rf {} +
|
||||
rm -rf node_modules/.pnpm/{typescript*,prettier*}
|
||||
shopt -s globstar
|
||||
# https://github.com/pnpm/pnpm/issues/3645
|
||||
find node_modules packages/**/node_modules -xtype l -delete
|
||||
|
||||
echo "Removed non-deterministic and unnecessary files"
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/{bin,lib/n8n}
|
||||
mv {packages,node_modules} $out/lib/n8n
|
||||
|
||||
makeWrapper $out/lib/n8n/packages/cli/bin/n8n $out/bin/n8n \
|
||||
--set N8N_RELEASE_TYPE "stable"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
tests = nixosTests.n8n;
|
||||
updateScript = ./update.sh;
|
||||
};
|
||||
|
||||
# this package has ~80000 files, these take too long and seem to be unnecessary
|
||||
dontStrip = true;
|
||||
dontPatchELF = true;
|
||||
dontRewriteSymlinks = true;
|
||||
|
||||
meta = {
|
||||
description = "Free and source-available fair-code licensed workflow automation tool";
|
||||
longDescription = ''
|
||||
Free and source-available fair-code licensed workflow automation tool.
|
||||
Easily automate tasks across different services.
|
||||
runHook postBuild
|
||||
'';
|
||||
homepage = "https://n8n.io";
|
||||
changelog = "https://github.com/n8n-io/n8n/releases/tag/n8n@${finalAttrs.version}";
|
||||
maintainers = with lib.maintainers; [gepbird AdrienLemaire sweenu];
|
||||
license = lib.licenses.sustainableUse;
|
||||
mainProgram = "n8n";
|
||||
platforms = lib.platforms.unix;
|
||||
};
|
||||
})
|
||||
|
||||
preInstall = ''
|
||||
echo "Removing non-deterministic and unnecessary files"
|
||||
|
||||
find -type d -name .turbo -exec rm -rf {} +
|
||||
rm node_modules/.modules.yaml
|
||||
rm packages/nodes-base/dist/types/nodes.json
|
||||
|
||||
CI=true pnpm --ignore-scripts prune --prod
|
||||
find -type f \( -name "*.ts" -o -name "*.map" \) -exec rm -rf {} +
|
||||
rm -rf node_modules/.pnpm/{typescript*,prettier*}
|
||||
shopt -s globstar
|
||||
# https://github.com/pnpm/pnpm/issues/3645
|
||||
find node_modules packages/**/node_modules -xtype l -delete
|
||||
|
||||
echo "Removed non-deterministic and unnecessary files"
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/{bin,lib/n8n}
|
||||
cp -r {packages,node_modules} $out/lib/n8n
|
||||
|
||||
makeWrapper $out/lib/n8n/packages/cli/bin/n8n $out/bin/n8n \
|
||||
--set N8N_RELEASE_TYPE "stable"
|
||||
|
||||
# JavaScript runner
|
||||
makeWrapper ${nodejs}/bin/node $out/bin/n8n-task-runner \
|
||||
--add-flags "$out/lib/n8n/packages/@n8n/task-runner/dist/start.js"
|
||||
|
||||
# Python runner
|
||||
mkdir -p $out/lib/n8n-task-runner-python
|
||||
cp -r packages/@n8n/task-runner-python/* $out/lib/n8n-task-runner-python/
|
||||
makeWrapper ${python}/bin/python $out/bin/n8n-task-runner-python \
|
||||
--add-flags "$out/lib/n8n-task-runner-python/src/main.py" \
|
||||
--prefix PYTHONPATH : "$out/lib/n8n-task-runner-python"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
tests = nixosTests.n8n;
|
||||
updateScript = ./update.sh;
|
||||
};
|
||||
|
||||
# this package has ~80000 files, these take too long and seem to be unnecessary
|
||||
dontStrip = true;
|
||||
dontPatchELF = true;
|
||||
dontRewriteSymlinks = true;
|
||||
|
||||
meta = {
|
||||
description = "Free and source-available fair-code licensed workflow automation tool";
|
||||
longDescription = ''
|
||||
Free and source-available fair-code licensed workflow automation tool.
|
||||
Easily automate tasks across different services.
|
||||
'';
|
||||
homepage = "https://n8n.io";
|
||||
changelog = "https://github.com/n8n-io/n8n/releases/tag/n8n@${finalAttrs.version}";
|
||||
maintainers = with lib.maintainers; [gepbird AdrienLemaire sweenu];
|
||||
license = lib.licenses.sustainableUse;
|
||||
mainProgram = "n8n";
|
||||
platforms = lib.platforms.unix;
|
||||
};
|
||||
})
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
set -euo pipefail
|
||||
|
||||
new_version="$(curl -s "https://api.github.com/repos/n8n-io/n8n/releases/latest" | jq --raw-output '.tag_name | ltrimstr("n8n@")')"
|
||||
nix-update n8n --version "$new_version"
|
||||
nix-update n8n --flake --version "$new_version"
|
||||
|
||||
31
pkgs/notesmd-cli/default.nix
Normal file
31
pkgs/notesmd-cli/default.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
lib,
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
nix-update-script,
|
||||
}:
|
||||
buildGoModule (finalAttrs: {
|
||||
pname = "notesmd-cli";
|
||||
version = "0.3.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Yakitrak";
|
||||
repo = "notesmd-cli";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-/yewtA5eJ4hxwZ4bBx8Pef+/TSY6Hfv15AAB9lxsW+4=";
|
||||
};
|
||||
|
||||
vendorHash = null;
|
||||
|
||||
ldflags = ["-s" "-w"];
|
||||
|
||||
passthru.updateScript = nix-update-script {};
|
||||
|
||||
meta = {
|
||||
description = "Obsidian CLI (Community) - Interact with Obsidian in the terminal";
|
||||
homepage = "https://github.com/Yakitrak/notesmd-cli";
|
||||
license = lib.licenses.mit;
|
||||
platforms = lib.platforms.unix;
|
||||
mainProgram = "notesmd-cli";
|
||||
};
|
||||
})
|
||||
@@ -13,16 +13,16 @@
|
||||
}:
|
||||
buildGoModule (finalAttrs: {
|
||||
pname = "sidecar";
|
||||
version = "0.71.1";
|
||||
version = "0.78.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "marcus";
|
||||
repo = "sidecar";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-LqpqNQ56tKXqEKbUrMxBkiGOzklGaqx8SCTEGIwE43k=";
|
||||
hash = "sha256-dVRSd8svfuv1+fYbHpFtXYHXvbAqomXKu9qi6Y5Y5S4=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-R/AjNJ4x4t1zXXzT+21cjY+9pxs4DVXU4xs88BQvHx4=";
|
||||
vendorHash = "sha256-WIhE4CNbxmXaCczLOpFmAkxFcM37iE2tFuUmRnKRN54=";
|
||||
|
||||
subPackages = ["cmd/sidecar"];
|
||||
|
||||
|
||||
@@ -9,16 +9,16 @@
|
||||
}:
|
||||
buildGoModule (finalAttrs: {
|
||||
pname = "td";
|
||||
version = "0.34.0";
|
||||
version = "0.42.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "marcus";
|
||||
repo = "td";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-VwVg+b8nhGbv2RgxDOUOSwFCIZyhA/Wt3lT9NUzw6aU=";
|
||||
hash = "sha256-fUvEgbwN3zBb4r64GwLlUNVydVacP0wiOIBb1BuPWzQ=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-Rp0lhnBLJx+exX7VLql3RfthTVk3LLftD6n6SsSWzVY=";
|
||||
vendorHash = "sha256-8mOebFPbf7+hCpn9hUrE0IGu6deEPSujr+yHqrzYEec=";
|
||||
|
||||
ldflags = [
|
||||
"-s"
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
# Development shells for various programming environments
|
||||
# Each shell can be accessed via: nix develop .#<shell-name>
|
||||
# Or used in home-manager/system configs
|
||||
{pkgs}: {
|
||||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
}: {
|
||||
# Default shell for working on this repository
|
||||
default = pkgs.mkShell {
|
||||
name = "m3ta-nixpkgs-dev";
|
||||
@@ -27,6 +30,7 @@
|
||||
};
|
||||
|
||||
# Import all individual shell environments
|
||||
python = import ./python.nix {inherit pkgs;};
|
||||
devops = import ./devops.nix {inherit pkgs;};
|
||||
python = import ./python.nix {inherit pkgs inputs;};
|
||||
devops = import ./devops.nix {inherit pkgs inputs;};
|
||||
opencode = import ./opencode.nix {inherit pkgs inputs;};
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
# DevOps development environment
|
||||
# Usage: nix develop .#devops
|
||||
{pkgs}:
|
||||
{
|
||||
pkgs,
|
||||
inputs ? null,
|
||||
}:
|
||||
pkgs.mkShell {
|
||||
name = "devops-dev";
|
||||
|
||||
|
||||
155
shells/opencode.nix
Normal file
155
shells/opencode.nix
Normal file
@@ -0,0 +1,155 @@
|
||||
# OpenCode development environment with AI coding rules
|
||||
# This shell demonstrates the mkOpencodeRules library provided by this repository
|
||||
# Usage: nix develop .#opencode
|
||||
#
|
||||
# To enable OpenCode rules, add the agents input to your flake:
|
||||
# agents = {
|
||||
# url = "git+https://code.m3ta.dev/m3tam3re/AGENTS";
|
||||
# flake = false;
|
||||
# };
|
||||
{
|
||||
pkgs,
|
||||
lib ? pkgs.lib,
|
||||
inputs ? null,
|
||||
agents ? null,
|
||||
}: let
|
||||
# Import the opencode-rules library
|
||||
m3taLib = import ../lib {lib = pkgs.lib;};
|
||||
|
||||
# Import custom packages
|
||||
customPackages = import ../pkgs {inherit pkgs inputs;};
|
||||
|
||||
# Create rules configuration only if agents input is provided
|
||||
# This demonstrates how to use mkOpencodeRules in a real project
|
||||
rulesConfig = lib.optionalAttrs (agents != null) {
|
||||
rules = m3taLib.opencode-rules.mkOpencodeRules {
|
||||
# Pass the AGENTS repository path
|
||||
inherit agents;
|
||||
|
||||
# Languages relevant to this repository
|
||||
languages = ["python" "typescript" "nix"];
|
||||
|
||||
# Frameworks used in this repo
|
||||
frameworks = ["n8n"];
|
||||
|
||||
# Standard concerns for development
|
||||
concerns = [
|
||||
"coding-style"
|
||||
"naming"
|
||||
"documentation"
|
||||
"testing"
|
||||
"git-workflow"
|
||||
"project-structure"
|
||||
];
|
||||
};
|
||||
};
|
||||
in
|
||||
pkgs.mkShell {
|
||||
name = "opencode-dev";
|
||||
|
||||
# Development tools
|
||||
buildInputs = with pkgs;
|
||||
[
|
||||
# OpenCode AI coding agent (if inputs are available)
|
||||
]
|
||||
++ lib.optionals (inputs != null)
|
||||
[inputs.opencode.packages.${pkgs.system}.opencode]
|
||||
++ [
|
||||
# Task management for AI coding sessions
|
||||
customPackages.td
|
||||
|
||||
# Companion tool for CLI agents (diffs, file trees, task management)
|
||||
customPackages.sidecar
|
||||
|
||||
# Code analysis tools
|
||||
customPackages.code2prompt
|
||||
|
||||
# Nix development tools (for this repo)
|
||||
nil
|
||||
alejandra
|
||||
statix
|
||||
deadnix
|
||||
];
|
||||
|
||||
# Shell hook that sets up OpenCode rules
|
||||
shellHook = ''
|
||||
echo "🤖 OpenCode Development Environment"
|
||||
echo ""
|
||||
echo "This environment demonstrates the mkOpencodeRules library"
|
||||
echo "provided by the m3ta-nixpkgs repository."
|
||||
echo ""
|
||||
|
||||
${
|
||||
if (agents != null)
|
||||
then ''
|
||||
# Execute the OpenCode rules shellHook
|
||||
${rulesConfig.rules.shellHook}
|
||||
|
||||
echo "✅ OpenCode rules configured!"
|
||||
''
|
||||
else ''
|
||||
echo "⚠️ OpenCode rules not configured"
|
||||
echo ""
|
||||
echo "To enable OpenCode rules, add the agents input to your flake.nix:"
|
||||
echo ""
|
||||
echo " inputs = {"
|
||||
echo " m3ta-nixpkgs.url = \"git+https://code.m3ta.dev/m3tam3re/nixpkgs\";"
|
||||
echo " agents = {"
|
||||
echo " url = \"git+https://code.m3ta.dev/m3tam3re/AGENTS\";"
|
||||
echo " flake = false;"
|
||||
echo " };"
|
||||
echo " };"
|
||||
echo ""
|
||||
echo "Then pass agents to the shell:"
|
||||
echo " opencode = import ./opencode.nix { inherit pkgs inputs agents; };"
|
||||
''
|
||||
}
|
||||
|
||||
echo ""
|
||||
echo "Available tools:"
|
||||
echo " opencode - AI coding agent"
|
||||
echo " td usage --new-session - View current tasks"
|
||||
echo " sidecar - Companion tool (diffs, file trees, tasks)"
|
||||
echo " code2prompt - Convert code to prompts"
|
||||
echo ""
|
||||
echo "Nix development tools:"
|
||||
echo " nix flake check - Check flake validity"
|
||||
echo " nix fmt . - Format Nix files"
|
||||
echo " statix check . - Lint Nix files"
|
||||
echo " deadnix . - Find dead code"
|
||||
echo ""
|
||||
${
|
||||
if (agents == null)
|
||||
then ''
|
||||
echo "💡 Using mkOpencodeRules in your project:"
|
||||
echo ""
|
||||
echo "Add to your flake.nix:"
|
||||
echo " inputs = {"
|
||||
echo " m3ta-nixpkgs.url = \"git+https://code.m3ta.dev/m3tam3re/nixpkgs\";"
|
||||
echo " agents = {"
|
||||
echo " url = \"git+https://code.m3ta.dev/m3tam3re/AGENTS\";"
|
||||
echo " flake = false;"
|
||||
echo " };"
|
||||
echo " };"
|
||||
echo ""
|
||||
echo " outputs = {self, nixpkgs, m3ta-nixpkgs, agents, ...}:"
|
||||
echo " let"
|
||||
echo " system = \"x86_64-linux\";"
|
||||
echo " pkgs = nixpkgs.legacyPackages.''${system};"
|
||||
echo " m3taLib = m3ta-nixpkgs.lib.''${system};"
|
||||
echo " rules = m3taLib.opencode-rules.mkOpencodeRules {"
|
||||
echo " inherit agents;"
|
||||
echo " languages = [\"python\" \"typescript\"];"
|
||||
echo " frameworks = [\"n8n\"];"
|
||||
echo " };"
|
||||
echo " in {"
|
||||
echo " devShells.''${system}.default = pkgs.mkShell {"
|
||||
echo " shellHook = rules.shellHook;"
|
||||
echo " };"
|
||||
echo " };"
|
||||
''
|
||||
else ""
|
||||
}
|
||||
echo ""
|
||||
'';
|
||||
}
|
||||
@@ -1,6 +1,9 @@
|
||||
# Modern Python development environment with marimo and uv — Nushell version
|
||||
# Usage: nix develop .#python (drops into Nushell)
|
||||
{pkgs}: let
|
||||
{
|
||||
pkgs,
|
||||
inputs ? null,
|
||||
}: let
|
||||
# Use the latest Python available in nixpkgs
|
||||
python = pkgs.python313;
|
||||
in
|
||||
|
||||
Reference in New Issue
Block a user