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

Development environments are not hermetic #241

Open
link2xt opened this issue Feb 28, 2023 · 3 comments
Open

Development environments are not hermetic #241

link2xt opened this issue Feb 28, 2023 · 3 comments

Comments

@link2xt
Copy link

link2xt commented Feb 28, 2023

Page src/pages/start/3.nix-develop.mdx says

As you can see, Nix development environments are hermetic in that they're isolated from the surrounding environment (such as your environment variables and paths like /bin and /usr/bin).

But when I run

$ nix develop "github:DeterminateSystems/zero-to-nix#example" --command which mutt

it outputs "/usr/bin/mutt".

@link2xt link2xt changed the title Developmen environments are not hermetic Development environments are not hermetic Mar 1, 2023
@alper
Copy link

alper commented May 5, 2023

You can add -i and that should get rid of the mutt.

See: NixOS/nix#4359 (comment)

@JoshMcguigan
Copy link

This also tripped me up when working through the zero to nix tutorial. Perhaps the sentence could be re-worded to specify -i is needed if you don't want access to env vars or paths from the host environment.

@matta
Copy link

matta commented Jul 28, 2024

I filed #357 before I realized it was a duplicate of this one. I'll repeat the suggestion I made there:

Suggestion: this section seems to be about introducing nix develop's --command option, which is an orthogonal issue to hermeticism. Since nix develop's hermeticism behavior does not depend on or vary with --command, perhaps delete mention of hermeticism from this section entirely. Optionally, add a section discussing the various nuances with respect to nix develop and hermeticism. The hermeticism achieved by these approaches are never perfect anyway, and perhaps deserve more than a passing mention.

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

No branches or pull requests

4 participants