From cea6d77f662d2b06b714c44d5df4a7eae7df9ed7 Mon Sep 17 00:00:00 2001 From: "Berk D. Demir" Date: Fri, 4 Jul 2025 13:59:34 -0700 Subject: [PATCH] _1password-gui{,-beta}: Re-enable Wayland support - Gate Electron's Ozone platform hint behind NIXOS_OZONE_WL env var. - No need to gate on WAYLAND_DISPLAY because Electron will first check XDG_SESSION_TYPE==wayland [^1], if it fails, then it will check for WAYLAND_DISPLAY[^2], even setting it to `wayland-0` if it finds a `wayland-0` socket under $XDG_SESSION_DIR. - No need to restore `--enable-features=WaylandWindowDecorations` switch as it's been enabled by default since Aug 2023. https://github.com/electron/electron/pull/39644/files - No point in passing --enable-wayland-ime=true, which requires GTK4 but 1Password ships linking only against GTK3. [^1] linux/display_server_utils.cc:MaybeFixPlatformName - https://source.chromium.org/chromium/chromium/src/+/main:ui/linux/display_server_utils.cc;l=72-74;drc=3a35ef8d20836722c95b230f7248c73faea599e7;bpv=0;bpt=1 [^2] linux/display_server_utils.cc:InspectWaylandDisplay - https://source.chromium.org/chromium/chromium/src/+/main:ui/linux/display_server_utils.cc;l=34-51;drc=3a35ef8d20836722c95b230f7248c73faea599e7;bpv=1;bpt=1 --- pkgs/by-name/_1/_1password-gui/linux.nix | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/_1/_1password-gui/linux.nix b/pkgs/by-name/_1/_1password-gui/linux.nix index 03fec5bd4922..009608d5f77e 100644 --- a/pkgs/by-name/_1/_1password-gui/linux.nix +++ b/pkgs/by-name/_1/_1password-gui/linux.nix @@ -146,12 +146,8 @@ stdenv.mkDerivation { makeShellWrapper $out/share/1password/1password $out/bin/1password \ "''${gappsWrapperArgs[@]}" \ --suffix PATH : ${lib.makeBinPath [ xdg-utils ]} \ - --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ udev ]} - # Currently half broken on wayland (e.g. no copy functionality) - # See: https://github.com/NixOS/nixpkgs/pull/232718#issuecomment-1582123406 - # Remove this comment when upstream fixes: - # https://1password.community/discussion/comment/624011/#Comment_624011 - #--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" + --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ udev ]} \ + --add-flags "\''${NIXOS_OZONE_WL:+--ozone-platform-hint=auto}" ''; passthru.updateScript = ./update.sh;