nix-community / nix-direnv

A fast, persistent use_nix/use_flake implementation for direnv [maintainer=@Mic92 / @bbenne10]
MIT License
1.78k stars 101 forks source link

Use flake fails silently #493

Closed vinicius507 closed 4 months ago

vinicius507 commented 4 months ago

I just upgraded my nixpkgs to unstable today and nix-direnv stopped building nix develop shells.

When I allow the .envrc it loads the environment variables but does not build the develop shell, although there are nothing stating that there was an error.

I'm really unsure of what is going on, so sorry about the lack of details. I'd be glad if anyone could help me understand what is going on.

I'm using direnv with the home-manager integration:

{
  programs.direnv = {
    enable = true;
    nix-direnv.enable = true;
  };
  home.sessionVariables.DIRENV_LOG_FORMAT = "";
}
bbenne10 commented 4 months ago

Have you tried with the DIRENV_LOG_FORMAT set so that direnv can show you what it's doing?

vinicius507 commented 4 months ago

Have you tried with the DIRENV_LOG_FORMAT set so that direnv can show you what it's doing?

Wow, how could I forget trying this out?

It seems like use flake usage changed between stable and unstable and I had the arguments order mixed up:

$ direnv allow
direnv: loading ~/Code/slidefy/.envrc
direnv: using flake --impure ../slidefy-nix
direnv: nix-direnv: the first argument must be a flake expression
direnv: export ~PATH

Mistake on my part. Thanks a ton @bbenne10