$ show openclaw/nix-openclaw
OpenClaw is a Nix flake that packages the OpenClaw AI assistant gateway for declarative installation on NixOS, macOS, and Home Manager. It provides a Home Manager module (programs.openclaw) and a NixOS module (services.openclaw-gateway) with options for instances, plugins, skills, workspace files, environment variables, and systemd/launchd services. The flake also includes an overlay, a Home Manager module for runtime plugins, and a set of Nix scripts that generate and validate plugin locks, config options, and runtime plugin materialization.
The LLM identified 5 files worth highlighting for reuse:
Implements semver-based API/peer/host range matching with numeric correction support; used to validate plugin compatibility against runtime constraints. Reusable because it isolates version-range logic from Nix code and can be unit-tested independently.
Validates and normalizes npm package-lock evidence for runtime plugins, producing normalized lock data and computing dependency hashes. Demonstrates a lock-materialization pattern that can be reused for other package managers.
Renders Nix attribute sets from lock data, generating the nix/generated/openclaw-runtime-plugins/*.nix files. Reusable as a template for converting structured lock data into Nix expressions.
Composable Home Manager module for OpenClaw, splitting options into options.nix, config.nix, instance.nix, and runtime-plugin files. Demonstrates a modular Nix module pattern with clear separation of concerns.
Generates Nix option definitions from upstream OpenClaw's Zod schema, producing nix/generated/openclaw-config-options.nix. Reusable as a code-generation pattern for keeping Nix types in sync with external JSON/YAML schemas.