From f6a8fdbda25d37c304b7b9765e9b71e9532a19ef Mon Sep 17 00:00:00 2001 From: James Ward Date: Mon, 6 Jul 2026 08:43:21 -0600 Subject: [PATCH] kiro-cli: fix wayland clipboard access On Wayland, kiro-cli shells out to wl-clipboard (wl-copy/wl-paste) for clipboard access. Wrap the binaries with makeBinaryWrapper to put wl-clipboard on the runtime PATH so clipboard support works out of the box under Wayland sessions. Co-authored-by: Horu <73709188+HigherOrderLogic@users.noreply.github.com> Co-authored-by: Peder Bergebakken Sundt --- pkgs/by-name/ki/kiro-cli/package.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pkgs/by-name/ki/kiro-cli/package.nix b/pkgs/by-name/ki/kiro-cli/package.nix index 3e41ce545e9c..b2a468be6fea 100644 --- a/pkgs/by-name/ki/kiro-cli/package.nix +++ b/pkgs/by-name/ki/kiro-cli/package.nix @@ -3,10 +3,17 @@ stdenv, fetchurl, autoPatchelfHook, + makeBinaryWrapper, undmg, versionCheckHook, xz, bzip2, + wl-clipboard, + # On Wayland, kiro-cli shells out to wl-clipboard (wl-copy/wl-paste) for + # clipboard access. Enabling this puts wl-clipboard on the runtime PATH so + # clipboard support works out of the box under Wayland sessions. Has no + # effect on Darwin. + waylandSupport ? stdenv.hostPlatform.isLinux, }: let @@ -41,6 +48,9 @@ stdenv.mkDerivation (finalAttrs: { lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ] + ++ lib.optionals (stdenv.hostPlatform.isLinux && waylandSupport) [ + makeBinaryWrapper + ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ undmg ]; @@ -65,6 +75,12 @@ stdenv.mkDerivation (finalAttrs: { install -Dm755 bin/kiro-cli-chat $out/bin/kiro-cli-chat install -Dm755 bin/kiro-cli-term $out/bin/kiro-cli-term '' + + lib.optionalString (stdenv.hostPlatform.isLinux && waylandSupport) '' + for bin in kiro-cli kiro-cli-chat kiro-cli-term; do + wrapProgram $out/bin/$bin \ + --suffix PATH : ${lib.makeBinPath [ wl-clipboard ]} + done + '' + lib.optionalString stdenv.hostPlatform.isDarwin '' mkdir -p $out/bin $out/Applications cp -r "../Kiro CLI.app" "$out/Applications/"