On Sat, 3 Dec 2022 at 20:11, Hugo Buddelmeijer wrote: > > But maybe 59771 (this bug), 59772 (also due to sudo), and 59776 (hardcoded > paths), all three could be resolved in a more guix-y way. The problem in > these three bugs is that "conda init" wants to add something to ~/.bashrc > that adds some bash functions to the environment (and the sole purpose of > those bash functions seems to be to update PS1). However, I was wondering, > would it be possible to have guix itself add those bash functions to the > environment? > > As in, we add some code to the guix conda package that ensures that if > guix enters an environment with conda, that it somehow adds the necessary > bash functions to the environment. So "conda init" and changes to ~/.bashrc > would not even be necessary (thus fixing these bugs). That is, that the > shell spawned through "guix shell -C conda" would have these bash functions > directly in the environment. Would something like this be possible? > No, adding bash functions automatically to a Guix environment seems impossible. The guile function load-profile allows packages to add path-like environment variables through the search-path-specification declaration, but not any other environment variables, let alone shell functions. That seems reasonable enough. One reason I'd like to move away from conda is that I don't think the way conda handles environment variables is tenable. So maybe it is worthwhile to make sure that "conda init" does what it is expected to do (that is, add the code that loads these bash functions to .bashrc), even though it is not really guix-y.