Skip to content

fix(nix): enable Wayland clipboard images - #48928

Merged
rekram1-node merged 2 commits into
anomalyco:v2from
hackrdotsh:nix-wayland-clipboard
Sep 14, 2026
Merged

rekram1-node merged 2 commits into
anomalyco:v2from
hackrdotsh:nix-wayland-clipboard

Conversation

@hackrdotsh

@hackrdotsh hackrdotsh commented Sep 14, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #48931

Related to #44310, specifically the NixOS image-paste report.

Build dependency: #48662 fixes the existing CLI binary-name mismatch in the Nix package.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds Wayland to the Nix CLI package and prefixes its library directory to LD_LIBRARY_PATH on Linux.

OpenTUI loads libwayland-client.so.0 at runtime to access clipboard images. On NixOS, that library lives in the Nix store and needs an explicit search path. This moves the working downstream wrapper fix into the package.

How did you verify your code works?

  • Evaluated the package for all four supported Linux/macOS architectures.
  • Reproduced the library-load failure with LD_LIBRARY_PATH unset; loading the same library succeeds with the path generated by this wrapper.
  • nix build .#opencode --no-link and the built CLI's --version passed with a local binary-source-path correction. That correction is excluded from this PR because fix(nix): install opencode and keep opencode2 alias #48662 covers it. Without it, the existing install step fails before wrapping the binary.
  • Interactive image paste has not been retested with this build specifically, however, my personal nix flake currently uses this fix for image pastes on Wayland.
  • bun run check could not run because the fresh checkout has no oxlint installed.

Screenshots / recordings

N/A, pending the nix packaging change.

However, here is a screenshot of it working with the equivalent fix applied to my flake:
image

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@rekram1-node
rekram1-node merged commit 6e43875 into anomalyco:v2 Sep 14, 2026
2 checks passed
jinhuang712 pushed a commit to jinhuang712/opencode that referenced this pull request Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants