nix-pills
nix-pills copied to clipboard
Pill 10: `make` is available from the user env
The pill says
$ nix-shell hello.nix
[nix-shell]$ make
bash: make: command not found
yet in my case
[nix-shell:~/projects/pills/hello]$ make
make: *** No targets specified and no makefile found. Stop.
so make is clearly available, but surprisingly it comes from my user env, even when launching as --pure
$ nix-shell --pure hello.nix
I find this very surprising, since the pill makes it sound like the shell is completely isolated, but it clearly is not.
this is working as intended, in the hello.nix file, there's a line:
inherit gnutar gzip gnumake gcc coreutils gawk gnused gnugrep;
gnumake package contains make, so when you use nix-shell hello.nix, you're bringing in those packages, and they will be made available even in a --pure environment.