DeterminateSystems / zero-to-nix

Zero to Nix is your guide to learning Nix and flakes. Created by Determinate Systems.

Home Page:https://zero-to-nix.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Development environments are not hermetic

link2xt opened this issue · comments

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".

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

See: NixOS/nix#4359 (comment)

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.