arrterian / nix-env-selector

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

Stuck applying environment #49

Closed faldor20 closed 3 years ago

faldor20 commented 3 years ago

Describe the bug When i select my environment it just says applying environment forever

To Reproduce Steps to reproduce the behavior: 1.Select envirnment 2.Select shell.nix 3.Wait forever?? Expected behavior It loads the environment.

Environment:

Additional context My nix shell:

{ pkgs ? import <nixpkgs> {} }:

pkgs.mkShell {
  buildInputs = [
    pkgs.hello

    # keep this line if you use bash
    pkgs.bashInteractive
  ];
}
cordarei commented 3 years ago

I've been getting this same behavior recently; I tried downgrading to 0.1.2 and it works fine, so it looks like the issue is only with version 1.0.2. I am using VSCode on Windows inside a WSL2 environment.

arrterian commented 3 years ago

Should be fixed in v1.0.4

arrterian commented 3 years ago

@faldor20 can you confirm that the issue resolved?

cordarei commented 3 years ago

Not the issue author, but I can confirm that 1.0.4 is working for me.

faldor20 commented 3 years ago

Yeah sorry. I'm not setup with nix right now. I'll take @cordarei 's word for it :)

Hjdskes commented 3 years ago

I seem to be facing this on 1.0.7. I'm using the workspace feature as suggested elsewhere:

{
    "folders": [
        {
            "path": "."
        }
    ],
    "settings": {
        "nixEnvSelector.suggestion": false,
        "nixEnvSelector.nixFile": "${workspaceRoot}/shell.nix"
    }
}

My shell.nix:

{ pkgs ? import ./haskell.nix
, hsPkgs ? import ./default.nix {} }:

let
  terraform = pkgs.terraform_0_14.withPlugins(p: [ p.aws ]);
in hsPkgs.shellFor {
  # Include only the *local* packages of your project.
  packages = ps: with ps;
    [ shiba ];

  # Builds a Hoogle documentation index of all dependencies,
  # and provides a "hoogle" command to search the index.
  withHoogle = true;

  # You might want some extra tools in the shell (optional).

  # Some common tools can be added with the `tools` argument
  tools = { cabal = "3.2.0.0"; hlint = "2.2.11"; stylish-haskell = "0.12.2.0"; };
  # See overlays/tools.nix for more details

  # Some you may need to get some other way.
  buildInputs = with hsPkgs.haskellPackages;
    [ terraform pkgs.awscli ];

  # Prevents cabal from choosing alternate plans, so that
  # *all* dependencies are provided by Nix.
  exactDeps = true;
}

It's a fairly standard haskell.nix setup. Let me know if you want me to open a new issue and if you need to see the rest of my nix files as well!

arrterian commented 3 years ago

@Hjdskes it seems there is not a related bug (I just miss error handling somewhere). Please, create a new issue with your problem.