petersweb-infra/nixos/arion-openclaw/arion-compose.nix
Philip Peterson 26d4bcc857 Add openclaw control center as arion service
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 13:25:30 -07:00

45 lines
1.1 KiB
Nix

{ pkgs, ... }:
{
project.name = "openclaw";
networks.openclaw.external = false;
services = {
app = {
service = {
image = "node:lts-alpine";
container_name = "openclaw";
restart = "unless-stopped";
networks = [ "openclaw" ];
volumes = [
"/var/openclaw/app:/app"
"/root/.openclaw:/root/.openclaw:ro"
];
ports = [ "127.0.0.1:4310:4310" ];
environment = {
PORT = "4310";
OPENCLAW_HOME = "/root/.openclaw";
};
command = [
"sh" "-c"
''
set -e
apk add --no-cache git
if [ ! -d /app/repo ]; then
git clone https://github.com/TianyiDataScience/openclaw-control-center.git /app/repo
fi
cd /app/repo
if [ ! -f .env ]; then
cp .env.example .env
sed -i "s|OPENCLAW_HOME=.*|OPENCLAW_HOME=/root/.openclaw|" .env
sed -i "s|PORT=.*|PORT=4310|" .env
fi
npm install
npm run build
exec npm run dev:ui
''
];
};
};
};
}