cachix / devenv

Fast, Declarative, Reproducible, and Composable Developer Environments
https://devenv.sh
Apache License 2.0
4.17k stars 313 forks source link

nix flake check fails (flake-module version) #1283

Open lutzgo opened 3 months ago

lutzgo commented 3 months ago

Describe the bug Dear devTeam, thank you for your great work! Empowered by your excellent product and concise documentation I am able to use devenv using the flake-module version. However, if I am running nix flake check on my repository, it fails with the following statement:

error: Failed assertions:
       - devenv was not able to determine the current directory.

To reproduce You will find my flake.nix, flake-module.nix and the .envrc followed by some logs. gist: reproduce bug: nix flake check fails

Version devenv 1.0.6 (x86_64-linux)

sandydoo commented 3 months ago

devenv needs to know what your current directory is, which isn't normally possible with Nix flakes. Your options are:

  1. Use --impure
  2. Use the input hack that the flake-parts template does: https://github.com/cachix/devenv/blob/65e7d51c62114670d38c84aff6cfdfe2ca18bf57/templates/flake-parts/flake.nix#L5-L8