summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorDanny Milosavljevic <dannym@friendly-machines.com>2026-02-12 20:44:49 +0100
committerDanny Milosavljevic <dannym@friendly-machines.com>2026-02-13 10:45:43 +0100
commitfc62ea7409044a529cae346c2311e6f6fde1b16d (patch)
tree97aed0aec4773c58e42ef4932cb4201dade0b00e /gnu
parent46793f96cdfe55b695d996c0ba367e5fd37b81e4 (diff)
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
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/package-management.scm10
1 files changed, 8 insertions, 2 deletions
diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index a4a94d0aac5..a54fb8111af 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