From 3106530b1d30939dfc2e560600792486ca115cd3 Mon Sep 17 00:00:00 2001 From: Jacopone Date: Fri, 26 Dec 2025 20:02:31 +0100 Subject: [PATCH] fix: add native libraries for Electron/BrowserView support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds missing system libraries to extraPkgs to fix native module loading issues on NixOS. Without these, Cursor fails with: - native-keymap: Cannot find module './build/Debug/keymapping' - TypeError: Cannot read properties of null (reading 'getCurrentKeyboardLayout') - BrowserViewMainService: Cannot execute JavaScript Libraries added: - Keyboard/input: libxkbfile, libxkbcommon - Security/credentials: libsecret, nss, nspr - Graphics/GPU: libGL, libdrm, mesa - GTK/display: gtk3, glib, pango, cairo, gdk-pixbuf - Accessibility: at-spi2-atk, at-spi2-core (needed for BrowserView) - Wayland support: wayland - System integration: libnotify, cups, libpulseaudio, systemd - X11 libraries: libX11, libXcomposite, libXdamage, libXext, libXfixes, libXrandr, libxcb Tested on NixOS with Cursor 2.2.43 - all native-keymap errors resolved. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- package.nix | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/package.nix b/package.nix index dd9a741..403102e 100644 --- a/package.nix +++ b/package.nix @@ -6,6 +6,28 @@ makeWrapper, undmg, google-chrome, + # Additional libraries for Electron/webview support + libxkbfile, + libsecret, + libGL, + libdrm, + mesa, + nss, + nspr, + at-spi2-atk, + at-spi2-core, + libxkbcommon, + xorg, + wayland, + gtk3, + glib, + pango, + cairo, + gdk-pixbuf, + libnotify, + cups, + libpulseaudio, + systemd, }: let @@ -43,9 +65,45 @@ if stdenv.hostPlatform.isLinux then inherit pname version; src = source; - # Include Chrome in the FHS environment for Browser Automation + # Include Chrome and essential Electron/webview libraries in FHS environment extraPkgs = pkgs: [ google-chrome + # Keyboard/input handling (fixes native-keymap errors) + libxkbfile + libxkbcommon + xorg.libxkbfile + # Security/credentials + libsecret + nss + nspr + # Graphics/GPU + libGL + libdrm + mesa + # GTK/display + gtk3 + glib + pango + cairo + gdk-pixbuf + # Accessibility (needed for BrowserView) + at-spi2-atk + at-spi2-core + # Wayland support + wayland + # System integration + libnotify + cups + libpulseaudio + systemd + # X11 libraries + xorg.libX11 + xorg.libXcomposite + xorg.libXdamage + xorg.libXext + xorg.libXfixes + xorg.libXrandr + xorg.libxcb ]; # Ensure Chrome is accessible with standard names