feat(computer-use): add a headless X11/i3 environment

Give the idols-ruby and idols-kana VMs a headless computer-use
environment: Xvfb plus i3, driven by cua-driver (and computer-use-linux
as a fallback). Includes the system module (AT-SPI, fonts, Mesa, Clash
Verge proxy, proxy-region timezone), the home i3 module (Xvfb/i3/x11vnc
services, browser flags), host wiring and an eval test.
This commit is contained in:
Ryan Yin committed 2026-09-21 21:31:27 +08:00
1 parent 90761a6b73
commit 00aab5f562
11 files changed
+316 -2

No files matched your search

+2
View File
@@ -26,6 +26,8 @@ let
"secrets/nixos.nix"
"modules/nixos/server/server.nix"
"modules/nixos/server/qemu-guest-hardware-configuration.nix"
# headless computer-use environment (sway + desktop automation)
"modules/nixos/desktop/computer-use.nix"
# host specific
"hosts/idols-${name}"
])
+2
View File
@@ -26,6 +26,8 @@ let
"secrets/nixos.nix"
"modules/nixos/server/server.nix"
"modules/nixos/server/qemu-guest-hardware-configuration.nix"
# headless computer-use environment (sway + desktop automation)
"modules/nixos/desktop/computer-use.nix"
# host specific
"hosts/idols-${name}"
])
@@ -0,0 +1,22 @@
{
myvars,
lib,
}:
let
hosts = [
"ruby"
"kana"
];
in
lib.genAttrs hosts (name: {
computerUse = true;
atspi = true;
clashVerge = true;
timeZone = "America/Los_Angeles";
xvfbRestart = "always";
i3Restart = "always";
vnc = true;
cuaDriver = name == "ruby";
brave = true;
chromium = true;
})
@@ -0,0 +1,31 @@
{
myvars,
lib,
outputs,
}:
let
username = myvars.username;
hosts = [
"ruby"
"kana"
];
in
lib.genAttrs hosts (
name:
let
system = outputs.nixosConfigurations.${name}.config;
home = system.home-manager.users.${username};
in
{
computerUse = system.modules.desktop.computerUse.enable;
atspi = system.services.gnome.at-spi2-core.enable;
clashVerge = system.programs.clash-verge.enable;
timeZone = system.time.timeZone;
xvfbRestart = home.systemd.user.services.xvfb.Service.Restart;
i3Restart = home.systemd.user.services.i3.Service.Restart;
vnc = home.modules.desktop.computerUse.vnc;
cuaDriver = home.modules.desktop.computerUse.cuaDriver;
brave = home.programs.brave-origin.enable;
chromium = home.programs.chromium.enable;
}
)