Hi, I installed nix on arch linux using instructions from arch wiki. In step “Usage” there is command nix-env -iA nixpkgs.hello and I don’t know what -iA options are and can’t find information about them. At the end of “Usage” step, there is link to man page of nix-env, but there is no information about -iA. I also checked nix reference manual and nix-env --help for this information, with same success.
Do you know where I can find full manual about nix-env with explanations of what each options does?
You want to check the Nix Reference Manual for nix-env --install. The -i is shorthand for
nix-env --install args…
The description in the manual states:
If there are multiple derivations matching a name in args that have the same name (e.g., gcc-3.3.6 and gcc-4.1.1), then the derivation with the highest priority is used. A derivation can define a priority by declaring the meta.priority attribute. This attribute should be a number, with a higher value denoting a lower priority. The default priority is 5. If there are multiple matching derivations with the same priority, then the derivation with the highest version will be installed.You can force the installation of multiple derivations with the same name by being specific about the versions. For instance, nix-env --install gcc-3.3.6 gcc-4.1.1 will install both version of GCC (and will probably cause a user environment conflict!).
If --attr / -A is specified, the arguments are attribute paths that select attributes from the default Nix expression. This is faster than using derivation names and unambiguous.
You’re welcome.
To expand on my previous post, here’s an example:
You can search for available packages on search.nixos.org . If you want to install something, like e.g. lolcat, check the appropriate command under " How to install lolcat?" by clicking on “nix-env”. There you get the complete command, like this: