From 698b92d7fb26680ebb0328c5c6c985071ff79a0a Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Mon, 17 Jun 2024 12:43:47 +0200 Subject: Fix X server not picking up system library files --- nix/ld-utils.nix | 22 ++++++++++++++++++++++ nix/nixgl.nix | 14 ++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 nix/ld-utils.nix create mode 100644 nix/nixgl.nix (limited to 'nix') diff --git a/nix/ld-utils.nix b/nix/ld-utils.nix new file mode 100644 index 0000000..6201b63 --- /dev/null +++ b/nix/ld-utils.nix @@ -0,0 +1,22 @@ +# ld-utils is a collection of functions which are intended to be sourced into +# other scripts +pkgs: pkgs.writeShellScript "ld-utils.sh" '' + +# returns the colon-delimited LD_LIBRARY_PATH for host installed libraries, as +# determined by ldconfig. +function host_ld_lib_path { + ldconfig -v 2>/dev/null \ + | grep -v ^$'\t' \ + | cut -d':' -f1 \ + | tr -s ':\n' ':' \ + | head -c-1 +} + +# bin_ld_lib_path returns the colon-delimited LD_LIBRARY_PATH which is embedded +# into a particular binary as its RUNPATH. +function bin_ld_lib_path { + objdump -x "$1" \ + | grep "RUNPATH" \ + | awk '{print $2}' +} +'' diff --git a/nix/nixgl.nix b/nix/nixgl.nix new file mode 100644 index 0000000..82dbdfd --- /dev/null +++ b/nix/nixgl.nix @@ -0,0 +1,14 @@ +pkgs: let + + src = builtins.fetchTarball { + name = "nixgl-unstable"; + url = "https://github.com/guibou/nixGL/archive/7165ffbccbd2cf4379b6cd6d2edd1620a427e5ae.tar.gz"; + sha256 = "1wc85xqnq2wb008y9acb29jbfkc242m9697g2b8j6q3yqmfhrks1"; + }; + + nixgl = (import src) { + inherit pkgs; + enable32bits = false; + }; + +in nixgl.auto.nixGLDefault -- cgit v1.2.3