arrterian / nix-env-selector

Allows switch environment for Visual Studio Code using Nix Package Manager.
MIT License
221 stars 28 forks source link

shell.nix exetubables don't seem to be made available after selecting shell.nix #63

Closed bbarker closed 2 years ago

bbarker commented 2 years ago

I'd like to be able to use the Dhall LSP Server extension with dependencies made available via a shell.nix file.

To Reproduce I created a shell.nix file with the contents:

{ pkgs ? import <nixpkgs> {} }:
  pkgs.mkShell {
    # nativeBuildInputs is usually what you want -- tools you need to run
    nativeBuildInputs = [ pkgs.dhall-lsp-server ];
}

However, after selecting the Nix environment and reloading VS Code, I still get this error:

No `dhall-lsp-server` executable is available in the VSCode PATH.
You might need to install [Dhall LSP server](https://github.com/PanAeon/dhall-lsp-server).
Also you might want to set an absolute path to the `dhall-lsp-server` executable in the plugin settings.

In the vs code terminal, I can confirm the dhall-lsp-server executable is available after running nix-shell shell.nix.

Expected behavior I would expect VS Code to be able to find the dhall-lsp-server executable.

Environment:

bbarker commented 2 years ago

It looks like I also needed dhall from Nix: nativeBuildInputs = [ pkgs.dhall pkgs.dhall-lsp-server ];