Forrest logo
back to the nix tool

nix:tldr:e80b3

nix: Install some packages from nixpkgs permanently.
$ nix profile install ${nixpkgs#pkg1 nixpkgs#pkg2 nixpkgs#pkg3 ---}
try on your machine

The command you provided is not a valid Nix command. It seems to have some syntax errors. However, I can explain the general Nix syntax and how it applies to package installations.

In Nix, packages are defined in the Nixpkgs collection, which contains a vast collection of packages. To install packages, you can use the nix-env command or nix profile install if you are using Nix Flakes.

Here is the general syntax for installing multiple packages using nix-env:

nix-env -iA <attribute-name>1 -A <attribute-name>2 -A <attribute-name>3 ...

In the above command, <attribute-name>1, <attribute-name>2, etc. represent the names of the packages you want to install. These names correspond to the package attributes defined in the Nixpkgs collection. An attribute typically corresponds to a package, but it could also refer to a group of packages.

For example, if you want to install the packages pkg1, pkg2, and pkg3, you would use the following command:

nix-env -iA nixpkgs.pkg1 -A nixpkgs.pkg2 -A nixpkgs.pkg3

This command tells Nix to install the packages with the attribute names nixpkgs.pkg1, nixpkgs.pkg2, and nixpkgs.pkg3.

The {nixpkgs#pkg1 nixpkgs#pkg2 nixpkgs#pkg3 ---} part you provided does not seem to follow a valid Nix syntax. If you can provide more information or clarify your question, I can assist you further.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the nix tool