Closed domenkozar closed 1 month ago
It is possible to set DEVENV_ROOT
to support pure mode
See #706, #566 and #583
Why do we need plain Nix expressions as flake inputs? Why not just generate a flake that contains current environment variables, including PWD
, then just pass --override-input
to use the generated flake.
For devenv we can do that, but not for the flakes integration.
How about using --redirect:
nix develop --redirect .#devenv-root .
I think the current impure devenv.root
is a dangerous design when packing images via nix2container
, because the image content could depend on devenv.root
and reference to non-existing directory at runtime.
Ideally, there should be a perWorkingDirectory
submodule under devenv
, where we can access root
. Environment variables that contain abstract paths should be configured under devent.perWorkingDirectory.env
, instead of devent.env
In #745 we now generate PWD instead of using --impure
when using devenv
cli.
How about also avoid --impure
when using flake? See https://github.com/cachix/devenv/pull/745#discussion_r1285246995
Looking forward to the Python rewrite, as --impure
seems to prevent evaluation caching from occurring. This makes devenv annoyingly slow when e.g. entering directories with a use flake --impure
in .envrc
.
Looking forward to the Python rewrite, as
--impure
seems to prevent evaluation caching from occurring. This makes devenv annoyingly slow when e.g. entering directories with ause flake --impure
in.envrc
.
Unless one uses nix-direnv, which caches the nix shell environment. The point about evaluation caching stands though.
Why is this issue closed? --impure
is still needed according to https://devenv.sh/guides/using-with-flakes/#getting-started
This issue was about devenv itself, for flakes it needs to be fixed in Nix itself. Let's see if #1018 will work :)
https://github.com/NixOS/nix/issues/5663