Problem creating a package for flipper

Hi there,

I’ve created my first package, for a network monitoring tool called Flipper, that installs correctly, but then fails to run. I’ve had to add autoPatchelfHook because the binary can’t find most of the libraries it requires. When I execute it, I get:

[3056490:0100/000000.822682:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
fish: Job 1, 'flipper' terminated by signal SIGTRAP (Trace or breakpoint trap)

I think it’s an electron app under the hood, but I’m not totally sure. Any help would be greatly appreciated!

This is the full content of the package:

with import <nixpkgs> { };

stdenv.mkDerivation rec {
  pname = "flipper";
  version = "0.219.0";

  src = fetchzip {
    url = "https://github.com/facebook/flipper/releases/download/v${version}/Flipper-linux.zip";
    sha256 = "sha256-jzuANv+i1H8cxHV1WpfuRJiL2rtCbs/qU8wXZ16RVWk=";
    stripRoot = false;
  };

  dontConfigure = true;
  dontBuild = true;

  installPhase = ''
    mkdir -p $out/bin
    cp -r ./* $out/
    ln -s $out/flipper $out/bin/flipper
  '';

  nativeBuildInputs = [
    autoPatchelfHook
  ];

  buildInputs = [
    glib # libgobject-2.0.so.0, libglib-2.0.so.0, libgio-2.0.so.0
    nss # libnss3.so, libnssutil3.so, libsmime3.so
    nspr # libnspr4.so
    at-spi2-atk # libatk-1.0.so.0, libatk-bridge-2.0.so.0
    cups.lib # libcups.so.2
    dbus.lib # libdbus-1.so.3
    libdrm # libdrm.so.2
    gdk-pixbuf # libgdk_pixbuf-2.0.so.0
    gtk3 # libgtk-3.so.0
    pango # libpango-1.0.so.0
    cairo # libcairo.so.2
    xorg.libX11 # libX11.so.6
    xorg.libXcomposite # libXcomposite.so.1
    xorg.libXdamage # libXdamage.so.1
    xorg.libXext # libXext.so.6
    xorg.libXfixes # libXfixes.so.3
    xorg.libXrandr # libXrandr.so.2
    mesa # libgbm.so.1
    expat # libexpat.so.1
    xorg.libxcb # libxcb.so.1
    libxkbcommon # libxkbcommon.so.0
    alsa-lib # libasound.so.2
    at-spi2-atk # libatspi.so.0
  ];

  meta = with lib; {
    description = "Extensible mobile app debugger";
    homepage = "https://fbflipper.com/";
    platforms = platforms.linux;
  };
}