Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stuck applying environment #56

Open
Hjdskes opened this issue Apr 24, 2021 · 12 comments
Open

Stuck applying environment #56

Hjdskes opened this issue Apr 24, 2021 · 12 comments
Assignees
Labels
bug Something isn't working

Comments

@Hjdskes
Copy link

Hjdskes commented Apr 24, 2021

Describe the bug
Symptoms are equal to #49: after selecting the environment, the status remains "Applying environment..." forever.

To Reproduce
Steps to reproduce the behavior:

  1. Install nix-env-selector 1.0.7
  2. Apply environment:
    { 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 need to see the rest of my nix files as well! I have the same problem with my work machine, with a similar haskell.nix setup.

Expected behavior
I'd expect this plugin to do as advertised and load my nix environment.

Environment:

  • OS: Fedora 34 / Mac OS Big Sur
  • VS Code 1.55.2
  • Version 1.0.7
@Hjdskes Hjdskes added the bug Something isn't working label Apr 24, 2021
@ShamrockLee
Copy link

Same issue here.

@samuela
Copy link
Contributor

samuela commented Dec 1, 2021

How long does it take to enter the nix-shell from the command line? Sometimes activating a shell.nix requires downloading/building a bunch of stuff and I don't think nix-env-selector has a ui to show this. It just looks like it's taking a really really long time to load.

If nix-shell in the command line runs almost instantaneously but nix-env-selector takes a while than that sounds more like a bug to me.

@samuela
Copy link
Contributor

samuela commented Dec 1, 2021

See also #59

@ShamrockLee
Copy link

@samuela In my experience, This extension never finishes applying the environment from a flake, even if it has already been invoked before and the related stuff has been cached.

@samuela
Copy link
Contributor

samuela commented Feb 13, 2023

@ShamrockLee I am now encountering this issue when using flakes as well. nix devlop runs instantaneously but I'm stuck in "Applying environment..." limbo when using nix-env-selector

@aanderse
Copy link

@samuela do you get this error when using shell.nix as well, or only with flake.nix?

@samuela
Copy link
Contributor

samuela commented Apr 13, 2023

@samuela do you get this error when using shell.nix as well, or only with flake.nix?

I previously saw this issue when using shell.nix, but it's possible those issues have now been fixed. I continue to see this issue with flake.nix.

@aanderse
Copy link

Thanks. For anyone else who runs into this and can't find a solution I was able to get the direnv vscode plugin working nicely.

@aryairani
Copy link

I'm having this issue in 1.0.9.
@aanderse How were you able to get the direnv vscode plugin working nicely for this?

@aanderse
Copy link

aanderse commented Jun 4, 2023

@aryairani what troubles are you having with the direnv plugin? Maybe we should discuss that on their issue tracker instead of here.

@aryairani
Copy link

Hi @aanderse
I didn't try it or have troubles, I was just asking to clarify the workaround you mentioned in your earlier message.

@aanderse
Copy link

aanderse commented Jun 4, 2023

Ah, understood. Simply install the plugin, following instructions, create a .envrc file in your project, then your nix environment is loaded by vscode. Nice and simple.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants