From 0cac23c7bfee3ffbf2b5b54c670359f3cd4edde7 Mon Sep 17 00:00:00 2001 From: Michael Hoang Date: Fri, 31 Mar 2023 00:46:19 +0900 Subject: [PATCH] Fix `NIXOS_OZONE_WL` not working with 1Password --- pkgs/applications/misc/1password-gui/linux.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/misc/1password-gui/linux.nix b/pkgs/applications/misc/1password-gui/linux.nix index 07a7e4b42462..70b85169b79c 100644 --- a/pkgs/applications/misc/1password-gui/linux.nix +++ b/pkgs/applications/misc/1password-gui/linux.nix @@ -4,7 +4,7 @@ , version , src , meta -, makeWrapper +, makeShellWrapper , wrapGAppsHook , alsa-lib , at-spi2-atk @@ -49,7 +49,7 @@ let in stdenv.mkDerivation { inherit pname version src meta; - nativeBuildInputs = [ makeWrapper wrapGAppsHook ]; + nativeBuildInputs = [ makeShellWrapper wrapGAppsHook ]; buildInputs = [ glib ]; dontConfigure = true; @@ -120,12 +120,14 @@ in stdenv.mkDerivation { ''; preFixup = '' + # makeWrapper defaults to makeBinaryWrapper due to wrapGAppsHook + # but we need a shell wrapper specifically for `NIXOS_OZONE_WL`. # Electron is trying to open udev via dlopen() # and for some reason that doesn't seem to be impacted from the rpath. # Adding udev to LD_LIBRARY_PATH fixes that. # Make xdg-open overrideable at runtime. - makeWrapper $out/share/1password/1password $out/bin/1password \ - ''${gappsWrapperArgs[@]} \ + makeShellWrapper $out/share/1password/1password $out/bin/1password \ + "''${gappsWrapperArgs[@]}" \ --suffix PATH : ${lib.makeBinPath [ xdg-utils ]} \ --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ udev ]} \ --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"