nix-pills icon indicating copy to clipboard operation
nix-pills copied to clipboard

Pill 10: `make` is available from the user env

Open darthdeus opened this issue 5 years ago • 1 comments

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.

darthdeus avatar Nov 20 '19 08:11 darthdeus

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.

jonringer avatar Nov 20 '19 17:11 jonringer