1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

openclaw: give it a browser to play with

This commit is contained in:
2026-02-15 22:36:29 +01:00
parent f12beaa69e
commit d8bad81090

View File

@@ -1,4 +1,9 @@
{ config, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
{ {
users.users.openclaw = { users.users.openclaw = {
isSystemUser = true; isSystemUser = true;
@@ -9,10 +14,6 @@
shell = pkgs.bash; shell = pkgs.bash;
packages = [ packages = [
pkgs.llm-agents.openclaw pkgs.llm-agents.openclaw
pkgs.chromium
pkgs.xorg.xvfb
pkgs.xorg.xauth
pkgs.xorg.xkbcomp
]; ];
}; };
@@ -21,12 +22,8 @@
systemd.services.openclaw = { systemd.services.openclaw = {
description = "OpenClaw Gateway Service"; description = "OpenClaw Gateway Service";
after = [ after = [ "network.target" ];
"network.target"
"xvfb.service"
];
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
wants = [ "xvfb.service" ];
path = config.users.users.openclaw.packages; path = config.users.users.openclaw.packages;
@@ -87,21 +84,30 @@
environment = { environment = {
OPENCLAW_HOME = "/var/lib/openclaw"; OPENCLAW_HOME = "/var/lib/openclaw";
DISPLAY = ":99";
# tell OpenClaw where Chrome is
PUPPETEER_EXECUTABLE_PATH = "${pkgs.chromium}/bin/chromium";
}; };
}; };
systemd.services.xvfb = { systemd.services.openclaw-browser = {
description = "X Virtual Framebuffer"; description = "OpenClaw Browser (unrestricted)";
after = [ "network.target" ]; after = [ "network.target" ];
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
serviceConfig = { serviceConfig = {
User = "openclaw"; User = "openclaw";
Group = "openclaw"; Group = "openclaw";
ExecStart = "${pkgs.xorg.xvfb}/bin/Xvfb :99 -screen 0 1920x1080x24 +extension GLX +render -noreset"; WorkingDirectory = "/var/lib/openclaw";
Environment = "DISPLAY=:99"; # NO hardening here - let Chrome do its thing
ExecStart = "${lib.getExe pkgs.chromium} ${
lib.escapeShellArgs [
"--headless"
"--no-sandbox"
"--disable-setuid-sandbox"
"--disable-dev-shm-usage"
"--remote-debugging-port=9222"
"--remote-debugging-address=127.0.0.1"
]
}";
Restart = "always";
}; };
}; };
} }