Gabriella439 / haskell-nix

Nix and Haskell in production
1.14k stars 117 forks source link

Error: file 'nixpkgs' was not found in the Nix search path #73

Closed tarsbase closed 5 years ago

tarsbase commented 5 years ago

Hi,

After I ran nix-build release0.nix, it shows error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I), at /Users/allen/haskell-nix/project0/release0.nix:2:17

What should I do next? Thank you.

Gabriella439 commented 5 years ago

@1930s: What output do you get when you run the following command?


$ echo "${NIX_PATH}"
tarsbase commented 5 years ago

@Gabriel439 Nothing.

screen shot 2019-01-12 at 12 12 53 pm

Gabriella439 commented 5 years ago

@1930s: Then it looks like you have some misconfiguration in your local Nix installation. Usually when you install Nix the installer asks you to add some line like this to your ~/.profile:

. ~/.nix-profile/etc/profile.d/nix.sh

... so that when you log into your shell all of the necessary environment variables have been set. Could you check if you have that setup script added as a login script?

tarsbase commented 5 years ago

Thank you so much @Gabriel439, problem solved!

Gabriella439 commented 5 years ago

You're welcome! 🙂