Files
nix-config-ryan4yin/pkgs/computer-use-linux/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

57 lines
1.3 KiB
Nix

{
lib,
stdenv,
fetchurl,
autoPatchelfHook,
}:
let
version = "0.7.1";
# Prebuilt release binaries; the crate is not packaged in nixpkgs.
assets = {
x86_64-linux = {
target = "x86_64-unknown-linux-gnu";
hash = "sha256-Wp91gQrUKBjIoxIeEsRug4MYgZ6o6bcaDJoqq+RmmbQ=";
};
aarch64-linux = {
target = "aarch64-unknown-linux-gnu";
hash = "sha256-e376naC15EyNGfDN3ERTmvCPzd97v7WPzzVYq4zCjps=";
};
};
asset =
assets.${stdenv.hostPlatform.system}
or (throw "computer-use-linux: unsupported system ${stdenv.hostPlatform.system}");
in
stdenv.mkDerivation {
pname = "computer-use-linux";
inherit version;
src = fetchurl {
url = "https://github.com/agent-sh/computer-use-linux/releases/download/v${version}/computer-use-linux-${asset.target}";
inherit (asset) hash;
};
nativeBuildInputs = [ autoPatchelfHook ];
buildInputs = [ stdenv.cc.cc.lib ];
dontUnpack = true;
installPhase = ''
runHook preInstall
install -Dm755 $src $out/bin/computer-use-linux
runHook postInstall
'';
meta = {
description = "MCP server and CLI to control a Linux desktop";
homepage = "https://github.com/agent-sh/computer-use-linux";
license = lib.licenses.mit;
platforms = [
"x86_64-linux"
"aarch64-linux"
];
mainProgram = "computer-use-linux";
};
}