diff --git a/flake.lock b/flake.lock index 0714ddc8..d85c7162 100644 --- a/flake.lock +++ b/flake.lock @@ -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": { diff --git a/flake.nix b/flake.nix index d0e5909d..1269cd6a 100644 --- a/flake.nix +++ b/flake.nix @@ -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"; diff --git a/outputs/default.nix b/outputs/default.nix index 63c316c3..0cd143c9 100644 --- a/outputs/default.nix +++ b/outputs/default.nix @@ -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 { diff --git a/overlays/README.md b/overlays/README.md index 9e377807..9c301b1e 100644 --- a/overlays/README.md +++ b/overlays/README.md @@ -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`. diff --git a/overlays/computer-use-linux.nix b/overlays/computer-use-linux.nix index f67d3d12..39ac90fd 100644 --- a/overlays/computer-use-linux.nix +++ b/overlays/computer-use-linux.nix @@ -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; } diff --git a/overlays/cua-driver.nix b/overlays/cua-driver.nix index 1af0d79d..a99acc14 100644 --- a/overlays/cua-driver.nix +++ b/overlays/cua-driver.nix @@ -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; } diff --git a/pkgs/computer-use-linux/default.nix b/pkgs/computer-use-linux/default.nix deleted file mode 100644 index 0612c4ef..00000000 --- a/pkgs/computer-use-linux/default.nix +++ /dev/null @@ -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"; - }; -} diff --git a/pkgs/cua-driver/default.nix b/pkgs/cua-driver/default.nix deleted file mode 100644 index f6c66165..00000000 --- a/pkgs/cua-driver/default.nix +++ /dev/null @@ -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"; - }; -}