What is the difference between "nix-env -i" and "nix-env -iA nixpkgs.(package name)"?

I figured both commands does install what I want, and the later command (“-iA”) seems to be a lot faster, what is the difference between two commands?

-i is by name so Nix searches all of nixpkgs for something that matches, whereas -iA is by attribute, so it has to be an exact match and can be installed without searching first.

3 Likes