I know you can query for available packages with:
nix-env -qa search_term
from man
I'm curios, how is nix-env doing the search? Is it searching in my /nix/store or will perform some request on the binary cache server https://cache.nixos.org/ ?
It looks like it will work without network connection so I'm curios how does it know about the available packages?