This will build the go package and output its store path.
I also understand that is a function that should search for nixpkgs channel based on the NIX_PATH variable. If I run nix-instantiate --parse -E '<nixpkgs>' I will get the following output:
(__findFile __nixPath "nixpkgs")
so I guess it’s trying to find a file inside NIX_PATH.
However, on my local machine NIX_PATH is empty. If I run a echo $NIX_PATH I get an empty result.
So my question is, how come nix-build --no-out-link -E 'with import <nixpkgs> { }; go' command works even though my NIX_PATH is empty?
If I understand the code correctly, it sets the default to the equivalent of NIX_PATH="$HOME/.nix-defexpr/channels:nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixpkgs:/nix/var/nix/profiles/per-user/root/channels".