Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of impure mode #658

Closed
domenkozar opened this issue Jun 10, 2023 · 13 comments · Fixed by #1005
Closed

Get rid of impure mode #658

domenkozar opened this issue Jun 10, 2023 · 13 comments · Fixed by #1005
Labels
enhancement New feature or request

Comments

@domenkozar
Copy link
Member

NixOS/nix#5663

@domenkozar domenkozar added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Jun 10, 2023
@Atry
Copy link
Contributor

Atry commented Jul 7, 2023

It is possible to set DEVENV_ROOT to support pure mode
See #706, #566 and #583

@Atry
Copy link
Contributor

Atry commented Jul 12, 2023

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.

@domenkozar
Copy link
Member Author

For devenv we can do that, but not for the flakes integration.

@Atry
Copy link
Contributor

Atry commented Jul 12, 2023

How about using --redirect:

nix develop --redirect .#devenv-root .

@Atry
Copy link
Contributor

Atry commented Jul 22, 2023

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.

@Atry
Copy link
Contributor

Atry commented Jul 22, 2023

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

@domenkozar
Copy link
Member Author

In #745 we now generate PWD instead of using --impure when using devenv cli.

@domenkozar domenkozar mentioned this issue Aug 2, 2023
7 tasks
@Atry
Copy link
Contributor

Atry commented Sep 18, 2023

How about also avoid --impure when using flake? See #745 (comment)

@khaled
Copy link

khaled commented Feb 18, 2024

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.

@khaled
Copy link

khaled commented Feb 20, 2024

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.

Unless one uses nix-direnv, which caches the nix shell environment. The point about evaluation caching stands though.

@domenkozar domenkozar mentioned this issue Mar 11, 2024
2 tasks
@Atry
Copy link
Contributor

Atry commented Mar 20, 2024

Why is this issue closed? --impure is still needed according to https://devenv.sh/guides/using-with-flakes/#getting-started

@Atry
Copy link
Contributor

Atry commented Mar 20, 2024

See #1018

@domenkozar
Copy link
Member Author

This issue was about devenv itself, for flakes it needs to be fixed in Nix itself. Let's see if #1018 will work :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants