home / skills / openclaw / skills / nix-mode

This skill helps Clawdbot operate in Nix mode by guiding configuration, path handling, and environment detection without auto-install.

npx playbooks add skill openclaw/skills --skill nix-mode

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
1.3 KB
---
name: nix-mode
description: Handle Clawdbot operations in Nix mode (configuration management, environment detection).
metadata: {"clawdbot":{"emoji":"❄️","requires":{"bins":["nix","bash"],"envs":["CLAWDBOT_NIX_MODE"]},"install":[]}}
---

# Clawdbot Nix Mode Skill

This skill handles Clawdbot operations specifically when running in Nix mode.

## Nix Mode Specific Features

### Environment Detection
- Detect when `CLAWDBOT_NIX_MODE=1` is set
- Identify Nix-managed configuration paths
- Recognize Nix-specific error messages and behaviors

### Configuration Management
- Understand that auto-install flows are disabled in Nix mode
- Guide users to proper Nix package management
- Explain why certain self-modification features are unavailable

### Path Handling
- Recognize Nix store paths
- Understand the difference between config and state directories
- Handle `CLAWDBOT_CONFIG_PATH` and `CLAWDBOT_STATE_DIR` appropriately

### Troubleshooting
- Identify Nix-specific remediation messages
- Guide users to proper dependency management via Nix
- Explain the read-only Nix mode banner behavior

## Usage Guidelines

When operating in Nix mode:
1. Do not attempt to auto-install dependencies
2. Direct users to Nix package management instead
3. Respect the immutable nature of Nix installations
4. Advise on proper configuration practices for Nix environments

Overview

This skill manages Clawdbot behavior when running in Nix mode, focusing on safe configuration handling and environment-aware guidance. It prevents operations that break immutable Nix deployments and gives clear instructions for using Nix package management and proper config/state paths. It is designed to make Clawdbot predictable and transparent in Nix-managed systems.

How this skill works

The skill detects Nix mode by checking the CLAWDBOT_NIX_MODE environment variable and inspecting known Nix store and profile paths. It recognizes Nix-specific error messages and read-only behaviors, and it adjusts actions accordingly by disabling auto-install flows and self-modification features. It also maps CLAWDBOT_CONFIG_PATH and CLAWDBOT_STATE_DIR to their Nix-aware locations and surfaces remediation steps that point to Nix package and configuration workflows.

When to use it

  • Running Clawdbot on systems built or managed with Nix/NixOS
  • When CLAWDBOT_NIX_MODE=1 is set in the environment
  • Deployments with immutable binaries or read-only system images
  • When you need guidance on Nix package or configuration handling
  • Troubleshooting Nix-specific error messages from Clawdbot

Best practices

  • Never attempt auto-install or in-place binary replacement in Nix mode
  • Use Nix expressions or flakes to add dependencies instead of runtime installers
  • Keep configuration in declared Nix-managed paths and treat state as mutable elsewhere
  • Document CLAWDBOT_CONFIG_PATH and CLAWDBOT_STATE_DIR in your Nix manifests
  • Surface actionable remediation: point to the correct Nix package, module, or overlay

Example use cases

  • Detecting Nix mode on container startup and disabling installers to avoid failures
  • Converting a runtime dependency error into a clear instruction to add a Nix package
  • Mapping user-specified config paths to Nix store or profile locations for diagnostics
  • Showing a read-only banner and explaining why self-updates are blocked
  • Providing tidy troubleshooting steps for operators maintaining Nix-based images

FAQ

What happens if a dependency is missing in Nix mode?

The skill will avoid trying to install it and instead produce a remediation message that directs the operator to add the dependency via Nix (package, overlay, or flake).

Can I enable auto-install in Nix mode?

No. Auto-install and self-modification are intentionally disabled because Nix enforces immutability; use declarative Nix tooling to change runtime artifacts.