You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Occasionally, I need to use conda on my NixOS box. Normally, I'd use nix-shell to enter a buildFHSUserEnv, then run VSCode. This workflow isn't possible with remote-ssh, however, and this is where nix-env-selector is fantastic.
Describe the solution you'd like
I'd like to be able to use buildFHSUserEnv with nix-env-selector. A hacky solution would be to grep for "buildFHSUserEnv" in the *.nix file, and if found, to instead pass --argstr run XXX. Then, in the FHS, I could write `runScript = "bash --rcfile <(echo '. ~/.bashrc; conda activate caiman; ${run}')";
Describe alternatives you've considered
For shebang scripts, I use the workaround linked above: create an executable called conda for my conda.nixbuildFHSUserEnv:
#!/usr/bin/env bash
set -euo pipefail
fhs="/Computer/shell/conda.nix"
function run {
nix-shell --pure --argstr run "$*" "${fhs}"
}
if [[ $# -eq 0 ]]; then
run bash
else
run "conda $@"
fi
Then, in a python script I do (-S is for passing multiple arguments)
@tbenst I investigated the issue briefly. Sad but we need to run some shell command as process fork from node js and I didn't find the solution with buildFHSUserEnv if you can help to get env output inside the environment by forking process it can help in another way I think we should close the issue as unresolved in this context.
@tbenst
Now the extension works this way. https://github.com/arrterian/nix-env-selector/blob/master/src/helpers.ts#L22
We run env command inside nix-shell then parse the output through dotenv, then set each variable to node-process on extension host via process.env. If we can get the output from buildFHSUserEnv via forking some process I will able to implement that in extension. But I can't find a solution to how to do that.
Is your feature request related to a problem? Please describe.
Occasionally, I need to use conda on my NixOS box. Normally, I'd use
nix-shell
to enter abuildFHSUserEnv
, then run VSCode. This workflow isn't possible withremote-ssh
, however, and this is where nix-env-selector is fantastic.nix-env-selector uses nix-shell --run and this is unfortunately unsupported for
buildFHSUserEnv
. <- also has a workaround however.Describe the solution you'd like
I'd like to be able to use
buildFHSUserEnv
with nix-env-selector. A hacky solution would be to grep for "buildFHSUserEnv" in the *.nix file, and if found, to instead pass--argstr run XXX
. Then, in the FHS, I could write `runScript = "bash --rcfile <(echo '. ~/.bashrc; conda activate caiman; ${run}')";Describe alternatives you've considered
For shebang scripts, I use the workaround linked above: create an executable called
conda
for my conda.nixbuildFHSUserEnv
:Then, in a python script I do (
-S
is for passing multiple arguments)Unfortunately, I haven't succeeded in hooking in my conda wrapper with VScode's python interpreter selector.
The text was updated successfully, but these errors were encountered: