From 6ebf7100314a9811f2b6994b79124cf0936188ad Mon Sep 17 00:00:00 2001 From: Gregor Lohaus Date: Thu, 28 May 2026 22:53:41 +0200 Subject: [PATCH] super duper hacky shit --- flake.nix | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index 9dc3a7f..bd5c5e8 100644 --- a/flake.nix +++ b/flake.nix @@ -224,14 +224,6 @@ fi cp "$binary" "$out/bin/jprototerm" - currentRpath="$(patchelf --print-rpath "$out/bin/jprototerm" || true)" - filteredRpath="$(printf '%s' "$currentRpath" | tr ':' '\n' | grep -v 'libglvnd' | paste -sd: -)" - if [ -n "$filteredRpath" ]; then - filteredRpath="$filteredRpath:/usr/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu/nvidia/current" - else - filteredRpath="/usr/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu/nvidia/current" - fi - patchelf --set-rpath "$filteredRpath" "$out/bin/jprototerm" wrapProgram "$out/bin/jprototerm" \ --run 'if [ -d /usr/lib/x86_64-linux-gnu/nvidia/current ]; then export __GLX_VENDOR_LIBRARY_NAME="''${__GLX_VENDOR_LIBRARY_NAME:-nvidia}"; fi' \ @@ -240,6 +232,18 @@ runHook postInstall ''; + + postFixup = '' + binary="$out/bin/.jprototerm-wrapped" + currentRpath="$(patchelf --print-rpath "$binary" || true)" + filteredRpath="$(printf '%s' "$currentRpath" | tr ':' '\n' | grep -v 'libglvnd' | paste -sd: -)" + if [ -n "$filteredRpath" ]; then + filteredRpath="$filteredRpath:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu/nvidia/current" + else + filteredRpath="/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu/nvidia/current" + fi + patchelf --set-rpath "$filteredRpath" "$binary" + ''; }); in { default = jprototerm;