emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/nix-mode d6e895969b 400/500: Set the 'LD_LIBRARY_PATH' env


From: ELPA Syncer
Subject: [nongnu] elpa/nix-mode d6e895969b 400/500: Set the 'LD_LIBRARY_PATH' environment variable for mkShell
Date: Sat, 29 Jan 2022 08:27:49 -0500 (EST)

branch: elpa/nix-mode
commit d6e895969bc731d92a530ab17045baf2521aca6e
Author: yilinwei <yilin.wei10@gmail.com>
Commit: yilinwei <yilin.wei10@gmail.com>

    Set the 'LD_LIBRARY_PATH' environment variable for mkShell
    
    This relies on the 'LD_LIBRARY_PATH' attribute in the
    mkShell derivation and won't work for other commonly
    used methods such as setting the 'shellHook' attribute.
---
 nix-shell.el | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/nix-shell.el b/nix-shell.el
index c6d23e0c04..ba755db2f7 100644
--- a/nix-shell.el
+++ b/nix-shell.el
@@ -131,7 +131,9 @@ The DRV file to use."
                         (apply 'append
                                (mapcar (lambda (prop)
                                          (split-string (alist-get prop env)))
-                                       nix-shell-inputs)))))
+                                       nix-shell-inputs))))
+        ;; This attribute is in `mkShell' — ideally, we'd only check this 
variable in those cases.
+        (ld-library-path (alist-get 'LD_LIBRARY_PATH env)))
 
     ;; Prevent accidentally rebuilding the world.
     (unless (file-directory-p stdenv)
@@ -152,6 +154,13 @@ The DRV file to use."
        ;; (setq-local process-environment nil)
        )
 
+      ;; Set the LD_LIBRARY_PATH where applicable
+      (when ld-library-path
+       (make-local-variable 'process-environment)
+       (setq process-environment
+             (cons (format "LD_LIBRARY_PATH=%s" ld-library-path)
+                   process-environment)))
+
       (dolist (input inputs)
        (when (and (not (file-directory-p input))
                   nix-shell-auto-realise)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]