guix_mirror_bot pushed a commit to branch master
in repository guix.

commit fc62ea7409044a529cae346c2311e6f6fde1b16d
Author: Danny Milosavljevic <[email protected]>
AuthorDate: Thu Feb 12 20:44:49 2026 +0100

    gnu: conda: Make ~/.conda be tried LAST.
    
    * gnu/packages/package-management.scm 
(conda)[arguments]<#:phases>[wrap-executable]:
    Make CONDA_ENVS_PATH and CONDA_PKGS_DIRS be only defaulted to $HOME/.conda.
    
    Fixes guix/guix#4826
    
    Change-Id: Icd89f48aedf5e0d9eaa8294a810ae37d496e4872
---
 gnu/packages/package-management.scm | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/package-management.scm 
b/gnu/packages/package-management.scm
index a4a94d0aac..a54fb8111a 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -1613,13 +1613,19 @@ manage (install/update) them for you.")
               ;; directory, which would cause non-reproducible builds.
               (setenv "CONDA_PKGS_DIRS" "/tmp/conda-pkgs")))
           (add-after 'wrap 'wrap-executable
+            ;; Conda normally resolves envs_dirs and pkgs_dirs relative
+            ;; to sys.prefix, which on Guix points into the read-only
+            ;; store.  Redirect these to the user's home directory so
+            ;; conda can create environments and cache packages.  Use
+            ;; suffix (not prefix) so that user-supplied values (e.g.
+            ;; from "guix shell") take priority.
             (lambda _
               (wrap-program (string-append #$output "/bin/conda")
                 `("CONDA_EXE" prefix
                   (,(string-append #$output "/bin/conda")))
-                `("CONDA_ENVS_PATH" prefix
+                `("CONDA_ENVS_PATH" suffix
                   (,(string-append "$HOME/.conda/envs")))
-                `("CONDA_PKGS_DIRS" prefix
+                `("CONDA_PKGS_DIRS" suffix
                   (,(string-append "$HOME/.conda/pkgs")))))))))
     (native-inputs
      (list nss-certs-for-test

Reply via email to