summaryrefslogtreecommitdiff
path: root/alacritty
diff options
context:
space:
mode:
authorBrian Picciano <me@mediocregopher.com>2024-06-17 12:43:47 +0200
committerBrian Picciano <me@mediocregopher.com>2024-06-17 12:43:47 +0200
commit698b92d7fb26680ebb0328c5c6c985071ff79a0a (patch)
treeb51e7b3dff0053503a2b6bdad789f3a17a07f969 /alacritty
parent4576644b8f37f71fe82c51e95d1dc06615ef5f14 (diff)
Fix X server not picking up system library files
Diffstat (limited to 'alacritty')
-rw-r--r--alacritty/default.nix17
1 files changed, 5 insertions, 12 deletions
diff --git a/alacritty/default.nix b/alacritty/default.nix
index e9a955d..9350884 100644
--- a/alacritty/default.nix
+++ b/alacritty/default.nix
@@ -57,27 +57,20 @@
alacritty = pkgs.writeShellScriptBin "alacritty" ''
set -e -x
- host_ld_lib_path="$(
- ldconfig -v 2>/dev/null \
- | grep -v ^$'\t' \
- | tr -s ':\n' ':' \
- | head -c-1 \
- )"
+ source "${pkgs.ldUtils}"
- bin_ld_lib_path="$(
- objdump -x ${pkgs.alacritty}/bin/alacritty \
- | grep "RUNPATH" \
- | awk '{print $2}' \
- )"
+ host_ld_lib_path="$(host_ld_lib_path)"
host_dri_path="$(
- echo "$host_ld_lib_path" \
+ echo "$host_lib_path" \
| tr -s ':' '\n' \
| while read d; do if [ -d "$d/dri" ]; then echo "$d"/dri; fi; done \
| tr '\n' ':' \
| head -c-1
)"
+ bin_ld_lib_path="$(bin_ld_lib_path "${pkgs.alacritty}/bin/alacritty")"
+
# overwrite LD_LIBRARY_PATH such that the binary's ld search path is still
# searched first, but afterwards the host's ld search path is looked
# through. Similarly, the dri paths are set to be the hosts. This allows us