nix-env-selector
nix-env-selector copied to clipboard
Stuck applying environment
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:
- Install nix-env-selector 1.0.7
- Apply environment:
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.{ 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; }
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
Same issue here.
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.
See also https://github.com/arrterian/nix-env-selector/issues/59
@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.
@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
@samuela do you get this error when using shell.nix as well, or only with flake.nix?
@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.
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.
I'm having this issue in 1.0.9.
@aanderse How were you able to get the direnv vscode plugin working nicely for this?
@aryairani what troubles are you having with the direnv plugin? Maybe we should discuss that on their issue tracker instead of here.
Hi @aanderse I didn't try it or have troubles, I was just asking to clarify the workaround you mentioned in your earlier message.
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.