From 26d4bcc857c03688ba5292b115c233f1849b8545 Mon Sep 17 00:00:00 2001 From: Philip Peterson <1326208+philip-peterson@users.noreply.github.com> Date: Wed, 10 Jun 2026 13:25:30 -0700 Subject: [PATCH] Add openclaw control center as arion service Co-Authored-By: Claude Sonnet 4.6 --- nixos/arion-openclaw/arion-compose.nix | 45 ++++++++++++++++++++++++++ nixos/arion-openclaw/arion-pkgs.nix | 3 ++ nixos/linux.nix | 3 ++ 3 files changed, 51 insertions(+) create mode 100644 nixos/arion-openclaw/arion-compose.nix create mode 100644 nixos/arion-openclaw/arion-pkgs.nix diff --git a/nixos/arion-openclaw/arion-compose.nix b/nixos/arion-openclaw/arion-compose.nix new file mode 100644 index 0000000..014375d --- /dev/null +++ b/nixos/arion-openclaw/arion-compose.nix @@ -0,0 +1,45 @@ +{ 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 + '' + ]; + }; + }; + }; +} diff --git a/nixos/arion-openclaw/arion-pkgs.nix b/nixos/arion-openclaw/arion-pkgs.nix new file mode 100644 index 0000000..1d16305 --- /dev/null +++ b/nixos/arion-openclaw/arion-pkgs.nix @@ -0,0 +1,3 @@ +import { + system = "x86_64-linux"; +} diff --git a/nixos/linux.nix b/nixos/linux.nix index 382dc75..0c50b22 100644 --- a/nixos/linux.nix +++ b/nixos/linux.nix @@ -175,6 +175,7 @@ in { projects.riverside.settings = import ./arion-riverside/arion-compose.nix; projects.pluto.settings = import ./arion-pluto/arion-compose.nix; projects.paperless.settings = import ./arion-paperless/arion-compose.nix; + projects.openclaw.settings = import ./arion-openclaw/arion-compose.nix; }; # The arion NixOS module sets backend = "podman-socket" but doesn't inject @@ -184,6 +185,7 @@ in { systemd.services.arion-riverside.environment.DOCKER_HOST = "unix:///run/podman/podman.sock"; systemd.services.arion-pluto.environment.DOCKER_HOST = "unix:///run/podman/podman.sock"; systemd.services.arion-paperless.environment.DOCKER_HOST = "unix:///run/podman/podman.sock"; + systemd.services.arion-openclaw.environment.DOCKER_HOST = "unix:///run/podman/podman.sock"; # Build the VNC desktop image locally from the Dockerfile — no registry push/pull needed. # vncContext is a Nix store path that changes whenever any file under vnc-desktop/ changes, @@ -259,6 +261,7 @@ in { "d /var/paperless/consume 0755 root root" "d /var/paperless/postgres 0755 root root" "d /var/paperless/redis 0755 root root" + "d /var/openclaw/app 0755 root root" "d /var/riverside/files 0755 root root" "d /var/riverside/postgres 0755 root root" "d /var/lib/gitea-runner/ubuntu 0755 gitea-runner gitea-runner"