refactor: consume computer-use packages from NUR (#375)

* refactor: consume computer-use packages from NUR

* fix: expose flake inputs to package overlays

Package overlays are imported from two places with different argument
shapes: outputs/default.nix passes a set containing `inputs`, while
modules/base/overlays.nix passes the NixOS module args, where genSpecialArgs
spreads each flake input as a top-level argument. The new NUR-backed
overlays read `inputs.nur-ryan4yin`, so evaluation failed on the module
path. Also expose the whole flake input set as `inputs` in genSpecialArgs.

* chore: bump nur-ryan4yin input

Update the locked nur-packages revision to the current main (nixpkgs
26.05, unused packages removed).
This commit is contained in:
ryan4yin | 二花 authored and GitHub committed 2026-10-04 13:11:34 +08:00
1 parent bf193e4082
commit cf6c657e4a
8 files changed
+23 -125

No files matched your search

Generated
+3 -3
View File
@@ -919,11 +919,11 @@
]
},
"locked": {
"lastModified": 1782178436,
"narHash": "sha256-1gIhdoBDzKv0T+NsqYFkjEDiwAeI+dDab1Dfg4bavO0=",
"lastModified": 1791090163,
"narHash": "sha256-TP5TknnQUcLs6b8/gM03LycJEgNPgl6L9fv+qXVO5+E=",
"owner": "ryan4yin",
"repo": "nur-packages",
"rev": "c3207ff6d6bed0a35511b0fb7133d07d4b00e118",
"rev": "d88446404e5e048cee5c68d331ef162cc538277f",
"type": "github"
},
"original": {
+1 -2
View File
@@ -176,8 +176,7 @@
flake = false;
};
# Personal NUR packages. Nothing consumes it right now; kept ready for
# packages not yet available from the other inputs.
# Personal NUR packages.
nur-ryan4yin = {
url = "github:ryan4yin/nur-packages";
inputs.nixpkgs.follows = "nixpkgs";
+9 -1
View File
@@ -21,7 +21,15 @@ let
in
inputs
// {
inherit mylib myvars pkgs-stable;
# The spread above exposes each flake input as a top-level argument.
# Also expose the whole set as `inputs`, which the package overlays
# (`overlays/*.nix`) receive via `import ../overlays args`.
inherit
inputs
mylib
myvars
pkgs-stable
;
# use unstable branch for some packages to get the latest updates
# pkgs-unstable = import inputs.nixpkgs-unstable {
+5 -4
View File
@@ -11,8 +11,8 @@ through [Overlays - NixOS & Flakes Book](https://nixos-and-flakes.thiscute.world
overlays/
├── README.md
├── default.nix # Entrypoint for all overlays
├── computer-use-linux.nix # trycua/computer-use-linux package
├── cua-driver.nix # trycua/cua driver (cua-driver) package
├── computer-use-linux.nix # computer-use-linux from ryan4yin/nur-packages
├── cua-driver.nix # cua-driver from ryan4yin/nur-packages
├── smartctl-exporter/ # smartctl_exporter pinned to the #329 fix
│ └── default.nix
└── fcitx5/ # Chinese input method configuration
@@ -55,8 +55,9 @@ This overlay provides:
### 3. Package overlays
- `computer-use-linux.nix`: packages `pkgs/computer-use-linux`.
- `cua-driver.nix`: packages `pkgs/cua-driver` (used by the computer-use VMs).
- `computer-use-linux.nix`: exposes `computer-use-linux` from the `nur-ryan4yin` flake input.
- `cua-driver.nix`: exposes `cua-driver` from the `nur-ryan4yin` flake input (used by the
computer-use VMs).
- `smartctl-exporter/`: pins `prometheus-smartctl-exporter` to the upstream commit carrying PR
[#329](https://github.com/prometheus-community/smartctl_exporter/pull/329) until nixpkgs provides
a version containing the fix; see `overlays/smartctl-exporter/default.nix`.
+3 -2
View File
@@ -1,3 +1,4 @@
_: _final: prev: {
computer-use-linux = prev.callPackage ../pkgs/computer-use-linux { };
{ inputs, ... }: _final: prev: {
computer-use-linux =
inputs.nur-ryan4yin.packages.${prev.stdenv.hostPlatform.system}.computer-use-linux;
}
+2 -2
View File
@@ -1,3 +1,3 @@
_: _final: prev: {
cua-driver = prev.callPackage ../pkgs/cua-driver { };
{ inputs, ... }: _final: prev: {
cua-driver = inputs.nur-ryan4yin.packages.${prev.stdenv.hostPlatform.system}.cua-driver;
}
-56
View File
@@ -1,56 +0,0 @@
{
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";
};
}
-55
View File
@@ -1,55 +0,0 @@
{
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";
};
}