Files
nix-config/pkgs/cua-driver/default.nix
T
Ryan Yin 90761a6b73 feat(computer-use): package computer-use-linux and cua-driver
Package the prebuilt releases (computer-use-linux v0.7.1 and
cua-driver-rs v0.24.0) under pkgs/, injected through thin callPackage
overlays so they are easy to relocate to the NUR repository later.
2026-09-21 21:31:27 +08:00

56 lines
1.5 KiB
Nix

{
lib,
stdenv,
fetchurl,
autoPatchelfHook,
libxkbcommon,
xorg,
}:
let
version = "0.24.0";
# Prebuilt release binary; the crate is not packaged in nixpkgs.
asset = {
url = "https://github.com/trycua/cua/releases/download/cua-driver-rs-v${version}/cua-driver-rs-${version}-linux-x86_64-binary.tar.gz";
hash = "sha256-s7j/Ullf6xESGaoKyQ47NmGMxoaqggWu1PPn4aZ8e2Q=";
};
in
stdenv.mkDerivation {
pname = "cua-driver";
inherit version;
src = fetchurl asset;
nativeBuildInputs = [ autoPatchelfHook ];
buildInputs = [
stdenv.cc.cc.lib
xorg.libX11
xorg.libXi
libxkbcommon
];
sourceRoot = ".";
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
install -Dm755 cua-driver $out/bin/cua-driver
install -Dm755 cua-cursor-theme $out/lib/cua-driver/cua-cursor-theme
install -Dm755 libcua_driver_sdk.so $out/lib/cua-driver/libcua_driver_sdk.so
install -Dm755 cua_driver_node_runtime.node $out/lib/cua-driver/cua_driver_node_runtime.node
install -Dm644 cua_driver_abi.h $out/include/cua-driver/cua_driver_abi.h
mkdir -p $out/share/cua-driver
cp -r wayland-helper $out/share/cua-driver/wayland-helper
runHook postInstall
'';
meta = {
description = "Desktop-automation driver for computer-use agents (MCP/CLI)";
homepage = "https://github.com/trycua/cua";
license = lib.licenses.mit;
platforms = [ "x86_64-linux" ];
mainProgram = "cua-driver";
};
}