$ show openclaw/nix-openclaw-tools
This repository provides reproducible Nix packaging for a collection of CLI tools (summarize, discrawl, wacrawl, gogcli, goplaces, camsnap, sonoscli, peekaboo, poltergeist, sag, imsg, qmd) used in the OpenClaw ecosystem. It includes per-tool OpenClaw plugin metadata (skills) that teach AI agents how to use each tool. The repo features automated update workflows: a Go-based tool updater (`cmd/update-tools`) that fetches latest GitHub releases and updates Nix expressions with new versions and hashes, and a skill syncer (`cmd/sync-skills`) that pulls the latest skill definitions from upstream OpenClaw repositories. The Go code demonstrates solid engineering with proper timeout handling, process group management, atomic file updates, and comprehensive tests. The Nix expressions are well-structured, supporting multiple platforms (aarch64-darwin, x86_64-linux, aarch64-linux) and using pinned nixpkgs inputs for reproducibility. CI runs formatting checks, vetting, tests with race detector, and builds all packages on supported systems. The repository is actively maintained with frequent commits and automated CI runs.
The LLM identified 3 files worth highlighting for reuse:
Provides a generic RunCommand function that executes external commands with configurable timeout, process group management (Unix), and automatic cleanup of descendant processes on timeout or interrupt. It uses signal notification context and WaitDelay to ensure subprocesses are killed even if they retain output pipes. This is a reusable pattern for any Go project that needs to run external commands with robust lifecycle management.
Implements a LatestRelease function that fetches the latest GitHub release for a given repository using the GitHub API. It configures an HTTP client with a 30-second response header timeout but no body deadline, allowing slow responses to complete. Supports authentication via GH_TOKEN environment variable. This is a clean, reusable component for any Go project that needs to interact with GitHub releases.
Provides an editPackage function that reads a Nix expression file, applies modifications via a callback, and saves atomically with rollback on failure. It uses regex-based replacement for version, URL, and hash fields, and supports block-level replacements for source definitions. The atomic write pattern (write to temp file, rename) ensures partial updates don't corrupt the file. This pattern is reusable for any project that needs to programmatically update configuration files with safe rollback.