Comments (26)
I just installed this extension, got an automatic detection picker, selected my shell.nix. Then nothing happened, I read the readme stating "restart vscode". I tried by just reloading. Still nothing, so I tried the command and now it always gives me:
from nix-env-selector.
I chose a flake.nix
file and the extension seem stuck with it, not allowing to change (displaying the same error as OP). The developer tools show the following:
abstractExtensionService.ts:718 Activating extension 'arrterian.nix-env-selector' failed: Command failed: nix-shell "/Users/.../flake.nix" --run export
error: --- UsageError --- nix-shell
nix-shell requires a single derivation
Try 'nix-shell --help' for more information.
.
_logMessageInConsole @ abstractExtensionService.ts:718
localProcessExtensionHost.ts:265 Extension Host
localProcessExtensionHost.ts:266 error: --- UsageError --- nix-shellnix-shell requires a single derivationTry 'nix-shell --help' for more information.
from nix-env-selector.
I ran into this as well.
- system: `"x86_64-darwin"`
- host os: `Darwin 19.2.0, macOS 10.15.2`
- multi-user?: `no`
- sandbox: `no`
- version: `nix-env (Nix) 2.3.2`
- channels(maximiliantagher): `"nixpkgs-20.03pre207249.7e8454fb856"`
- nixpkgs: `/Users/maximiliantagher/.nix-defexpr/channels/nixpkgs`
Version: 1.49.1
Commit: 58bb7b2331731bf72587010e943852e13e6fd3cf
Date: 2020-09-16T23:21:17.533Z (1 wk ago)
Electron: 9.2.1
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Darwin x64 19.2.0
from nix-env-selector.
One person I was helping troubleshoot a similar issue resolved it by first opening a workspace (i.e. folder) in VSCode, then trying to select a Nix environment.
from nix-env-selector.
I's expected behavior. The extension can't work if there no workspace.
from nix-env-selector.
Sorry, I'm getting this same bug and I'm in a workspace. This only started happening today after I updated from 0.1.2 to 1.0.2. Any idea what might be the problem?
Also, if I downgrade to 0.1.2 I get a different problem:
Command failed: nix-shell /Users/hjones/programming/citizennet/orders/default.nix --run env /bin/sh: nix-shell: command not found
Though that seems to be related to #38
from nix-env-selector.
FWIW, I was able to work around this by installing the rubymaniac.vscode-direnv
Extension, downgrading this extension to 0.1.2, reload everything, then uninstall rubymaniac.vscode-direnv
. Something is definitely amiss, but I've no clue what.
from nix-env-selector.
@joneshf-cn I have couple of questions that can help me figure it out
- Does the error appears when you has already selected nix file in your config and want to select new one or only for blank config? (Or both?)
- Will the error still appear if you will wait for a minute before running the command?
from nix-env-selector.
- Does the error appears when you has already selected nix file in your config and want to select new one or only for blank config? (Or both?)
Both.
- Will the error still appear if you will wait for a minute before running the command?
Yes.
from nix-env-selector.
Can you guys share the installed extensions list? Maybe there is some conflict. I should reproduce the bug in my system to be able to fix it.
from nix-env-selector.
@hedefalk what OS do you use?
from nix-env-selector.
@hedefalk what OS do you use?
MacOS
from nix-env-selector.
I have the same error. Used to work a week ago. My setup: VS Code running in windows, remoting to nixos via SSH.
Not letting me select a environment, folder with shell.nix
is open (the same way it was before). I've tried downgrading the extension - the same issue. I take the regression is after VSCode update and not the extension update. Downgrading to 0.1.2 works.
My remote env:
- system: `"x86_64-linux"`
- host os: `Linux 5.11.0, NixOS, 21.05pre272380.f6b5bfdb470 (Okapi)`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.3.10`
- channels(andoriyu): `"home-manager"`
- channels(root): `"nixos-21.05pre274338.102eb68ceec"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
VSCode version: 1.54.1
from nix-env-selector.
@andoriyu Do you still get the error on v1.0.4
?
from nix-env-selector.
@andoriyu Do you still get the error on
v1.0.4
?
Somehow 20 minutes later it started working on 1.0.4.
from nix-env-selector.
Maybe you could make the current chosen environment accessible in the extension settings? USers could then switch manually and maybe workaround the error?
from nix-env-selector.
Since the extension is stuck on my flake.nix
file, I've been modifying it and I now run into this error:
Activating extension 'arrterian.nix-env-selector' failed: Command failed: nix-shell "/Users/../my_repo/flake.nix" --run export
warning: Git tree '/Users/...my_repo' is dirty
.
_logMessageInConsole @ abstractExtensionService.ts:718
_logOrShowMessage @ abstractExtensionService.ts:732
$onExtensionActivationError @ mainThreadExtensionService.ts:64
_doInvokeHandler @ rpcProtocol.ts:417
_invokeHandler @ rpcProtocol.ts:402
_receiveRequest @ rpcProtocol.ts:318
_receiveOneMessage @ rpcProtocol.ts:245
(anonymous) @ rpcProtocol.ts:110
fire @ event.ts:622
fire @ ipc.net.ts:468
_receiveMessage @ ipc.net.ts:821
(anonymous) @ ipc.net.ts:660
fire @ event.ts:622
acceptChunk @ ipc.net.ts:241
(anonymous) @ ipc.net.ts:202
I @ ipc.net.ts:32
emit @ events.js:315
addChunk @ _stream_readable.js:295
readableAddChunk @ _stream_readable.js:271
Readable.push @ _stream_readable.js:212
onStreamRead @ internal/stream_base_commons.js:186
localProcessExtensionHost.ts:265 Extension Host
localProcessExtensionHost.ts:266 warning: Git tree '/Users/../my_repo' is dirty
Then when trying to select the nix shell:
notificationsAlerts.ts:40 Command 'Nix-Env: Select environment' resulted in an error (command 'nixEnvSelector.selectEnv' not found)
Maybe warnings make the extension loading fail and results in the selectEnv
to not exist?
from nix-env-selector.
@jmatsushita seems that I know what is wrong now. It because unproper error handling for sync operation on extension load. Thanks a lot for your comment. I think I will fix it when will have I time soon.
from nix-env-selector.
@jmatsushita @InLaw added proper error handling. The problem should disappear in v1.0.6
from nix-env-selector.
@arrterian thanks, in my case it is working
from nix-env-selector.
Same here @arrterian it works. Thanks a ton!
from nix-env-selector.
1.0.6 also seemed to fix it for me. Thanks!
from nix-env-selector.
I just experienced this on a remote linux host on 1.0.7, then downgraded to 1.0.6 and it's working. EDIT: 1.0.6 worked for a remote-over-SSH situation but is failing locally. Problem seems to have come up starting from the recent 1.62.1 VS Code release (continuing on 1.62.2). If there's some info that would help pinpoint the issue please let me know.
from nix-env-selector.
If it helps, I also got success downgrading to 0.1.2. Then right away the chemical flask appears in the status bar and when I invoke the selectEnv it works. The chemical flask NEVER appears on the status bar in 1.0.6+. So maybe still a startup sequence error.
from nix-env-selector.
Hello it is back as well on my (new) setup,
Any idea to fix this?
from nix-env-selector.
continuous on 22.11:
Version: 1.73.1
Commit: 6261075646f055b99068d3688932416f2346dd3b
Date: 2022-11-09T03:54:53.913Z
Electron: 19.0.17
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Linux x64 5.15.86
Sandboxed: No
- system:
"x86_64-linux"
- host os:
Linux 5.15.86, NixOS, 22.11 (Raccoon), 22.11.1611.a83ed85c14f
- multi-user?:
yes
- sandbox:
yes
- version:
nix-env (Nix) 2.11.1
- channels(root):
"nixos-22.11, nixos-hardware"
- nixpkgs:
/nix/var/nix/profiles/per-user/root/channels/nixos
from nix-env-selector.
Related Issues (20)
- Stuck applying environment HOT 12
- Rustup packages as settings packages HOT 3
- Have the extension output logs in the Output window HOT 4
- Can't make my fhs env work HOT 1
- shell.nix exetubables don't seem to be made available after selecting shell.nix HOT 1
- [Feature]: Support shell.nix files outside of the project directory
- [BUG] Extension don't add package to PATH variable, when some active tabs need any package from shell.nix HOT 4
- "command 'nixEnvSelector.selectEnv' not found" HOT 1
- [Feature]: Support multiroot workspace HOT 2
- C/C++ Support: Can this be used to help generate the c_cpp_properties.json configuration file?
- [Documentation]: Document what `Hit environment` means
- [Feature]: Remember nix environment answer
- [Feature]: VSCode-Remote (SSH) support? HOT 6
- No longer applies shell.nix to integrated terminal? HOT 2
- Extension Development Host does not launch
- Can find packages from nix-shell, but not with nix-env-selector HOT 3
- TypeError when applying nix environment in Remote SSH HOT 3
- [Feature]: VSCodium support HOT 1
- Latest Pylance update brakes python environment HOT 1
- nix-env-selector does not work with flakes HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nix-env-selector.