Change:
Steps to reproduce the behavior: sparrow Add any other context about the problem here. <!-- Please @ people who are in the list of the offending package or module. If in doubt, check for whoever last touched something. -- Please run and paste the result.
TLDR; This was caused by and is fixed in Upstream bundles a JDK/JRE with sparrow. Our sparrow package does not use the bundled JDK and instead replaces it with a JDK from Nixpkgs. Since the sparrow bundle contains the JDK and the sparrow code in a single JIMAGE, the sparrow package compares the files in the JIMAGE with the files provided by the JDK in Nixpkgs in order to determine which files in the JIMAGE are part of the JDK. Those files are then excluded from the sparrow derivation. When disabled JavaFX by default it changed the output of the aforementioned comparison, leaving behind some files which belong to the JDK as part of the sparrow derivation; The files which are part of JavaFX. This in turn causes the patchelf procedure to fail because the sparrow package is only expected to patch sparrow-specific dependencies, not the JDK.

Discussion:
let pname = "sparrow"; <del> version = "1.7.1"; </del> <ins> version = "1.7.3"; </ins> src = fetchurl { url = "https://github.com/sparrowwallet/${pname}/releases/download/${version}/${pname}-${version}-x86_64.tar.gz"; <del> sha256 = "0q31b4ncvbhr9gb47wplphg43pwlg5vpd1b12qiidqlrkgm2vjy8"; </del> <ins> sha256 = "sha256-/tKct73v0zWAjY4kTllnb/+SB/8ENgVl8Yh/LErKTxY="; </ins> }; launcher = writeScript "sparrow" ''

ln -s ${hwi}/bin/hwi $out/modules/com.sparrowwallet.sparrow/native/linux/x64/hwi ''; }; <del> # To use the udev rules for connected hardware wallets, # add "pkgs.sparrow" to "services.udev.packages" and add user accounts to the user group "plugdev". udev-rules = stdenv.mkDerivation { name = "sparrow-udev"; src = let version = "2.0.2"; in fetchurl { url = "https://github.com/bitcoin-core/HWI/releases/download/${version}/hwi-${version}.tar.gz"; sha256 = "sha256-di1fRsMbwpHcBFNTCVivfxpwhUoUKLA3YTnJxKq/jHM="; }; installPhase = '' mkdir -p $out/etc/udev/rules.d cp -a hwilib/udev/* $out/etc/udev/rules.d rm $out/etc/udev/rules.d/README.md ''; }; </del> in stdenv.mkDerivation rec { inherit pname version src;

icon = pname; desktopName = "Sparrow Bitcoin Wallet"; genericName = "Bitcoin Wallet"; <del> categories = [ "Finance" ]; </del> <ins> categories = [ "Finance" "Network" ]; </ins> mimeTypes = [ "application/psbt" "application/bitcoin-transaction" "x-scheme-handler/bitcoin" "x-scheme-handler/auth47" "x-scheme-handler/lightning" ]; <ins> startupWMClass = "Sparrow"; </ins> }) ];

mkdir -p $out/share/icons ln -s ${sparrow-icons}/hicolor $out/share/icons <del> mkdir -p $out/etc/udev ln -s ${udev-rules}/etc/udev/rules.d $out/etc/udev/rules.d </del> <ins> mkdir -p $out/etc/udev/rules.d cp ${hwi}/lib/python*/site-packages/hwilib/udev/*.rules $out/etc/udev/rules.d </ins> runHook postInstall '';

<ins> { lib , buildFHSUserEnv , sparrow-unwrapped }: buildFHSUserEnv { name = "sparrow"; runScript = "${sparrow-unwrapped}/bin/sparrow"; targetPkgs = pkgs: with pkgs; [ sparrow-unwrapped pcsclite ]; multiPkgs = pkgs: with pkgs; [ pcsclite ]; extraInstallCommands = '' mkdir -p $out/share ln -s ${sparrow-unwrapped}/share/applications $out/share ln -s ${sparrow-unwrapped}/share/icons $out/share mkdir -p $out/etc/udev ln -s ${sparrow-unwrapped}/etc/udev/rules.d $out/etc/udev/rules.d ''; meta = sparrow-unwrapped.meta; } </ins>

sozu = callPackage ../servers/sozu { }; <del> sparrow = callPackage ../applications/blockchains/sparrow { openimajgrabber = callPackage ../applications/blockchains/sparrow/openimajgrabber.nix { }; </del> <ins> sparrow-unwrapped = callPackage ../applications/blockchains/sparrow { openimajgrabber = callPackage ../applications/blockchains/sparrow/openimajgrabber.nix {}; openjdk = openjdk.override { enableJavaFX = true; }; }; sparrow = callPackage ../applications/blockchains/sparrow/fhsenv.nix { buildFHSUserEnv = buildFHSUserEnvBubblewrap; </ins> }; sparsehash = callPackage ../development/libraries/sparsehash { };