devenv icon indicating copy to clipboard operation
devenv copied to clipboard

Give a way to turn off features that rely on finding the current directory

Open michaelpj opened this issue 1 year ago • 2 comments

Would it be at all possible to do this so we can run without --impure when using flakes? I'd be happy to manually set a DEVENV_ROOT variable in my direnv config if I had to!

michaelpj avatar Sep 20 '24 16:09 michaelpj

See https://github.com/cachix/devenv/pull/1418/files

domenkozar avatar Sep 23 '24 10:09 domenkozar

To expand a bit on this, as long as the module system has a value for devenv.root, everything should work.

There are 3 ways to make this happen with flakes (that I know of):

  1. Run nix develop with the --no-pure-eval flag. The module system will try to use builtins.getEnv "PWD" by default.
  2. Hard-code devenv.root to an absolute path to your working directory. Not portable.
  3. Use the above hack and use inputs to inject external data into the flake. The input update can be automated with direnv.

sandydoo avatar Nov 02 '24 12:11 sandydoo