FAQ: Difference between revisions
imported>Mic92 |
imported>Lheckemann Add docs on nix-env -i without -A |
||
| Line 24: | Line 24: | ||
This helps ensure purity of builds: on other distributions, the result of building a piece of software may depend on which other software you have installed. Nix attempts to avoid this to the greatest degree possible, which allows builds of a piece of software to be identical (in the ideal case) no matter where they're built, by requiring all dependencies to be declared. | This helps ensure purity of builds: on other distributions, the result of building a piece of software may depend on which other software you have installed. Nix attempts to avoid this to the greatest degree possible, which allows builds of a piece of software to be identical (in the ideal case) no matter where they're built, by requiring all dependencies to be declared. | ||
== Why not use nix-env -i foo? == | |||
<code>nix-env -i foo</code> is slower and tends to be less precise than <code>nix-env -f '<nixpkgs>' -iA foo</code>. This is because it will evaluate all of nixpkgs searching for packages with the name foo, and install the one [https://nixos.org/nix/manual/#description-1 determined to be the latest] (which may not even be the one that you want). Meanwhile, with <code>-A</code>, nix-env will evaluate only the given attribute in nixpkgs. This will be significantly faster, consume significantly less memory, and more likely to get you what you want. | |||
== How to keep build-time dependencies around / be able to rebuild while being offline? == | == How to keep build-time dependencies around / be able to rebuild while being offline? == | ||