Update a package: Difference between revisions

imported>Musicmatze
Remove ML link
imported>Rapenne-s
Remove an example of nix-env as a way to install packages
Line 173: Line 173:
* If your current directory is, as we said, <tt>~/devel/nixpkgs/</tt>, you can request nix to build the modified package (see <tt>man nix-build</tt>):
* If your current directory is, as we said, <tt>~/devel/nixpkgs/</tt>, you can request nix to build the modified package (see <tt>man nix-build</tt>):
<pre>nix-build -A i3</pre>
<pre>nix-build -A i3</pre>
* Alternatively, you can request nix to build from expressions on an specific directory (<tt>-f .</tt>)and then to update your user environment so you will have the newly built binaries, man pages etc. available at hand for testing (see <tt>man nix-env</tt>):
* In this invocation the <tt>i3</tt> in <tt>-A i3</tt> refers to <tt>i3 = callPackage ...</tt> in <tt>pkgs/top-level/all-packages.nix</tt>. In the same way as the <tt>pango</tt> we talked about above, both names are attributes from the top-level Nix expression being evaluated. In this case <tt>~/devel/nixpkgs/default.nix</tt>
<pre>nix-env -f . -iA i3</pre>
* In these two invocations the <tt>i3</tt> in <tt>-A i3</tt> refers to <tt>i3 = callPackage ...</tt> in <tt>pkgs/top-level/all-packages.nix</tt>. In the same way as the <tt>pango</tt> we talked about above, both names are attributes from the top-level Nix expression being evaluated. In this case <tt>~/devel/nixpkgs/default.nix</tt>
* Here I would have detected the error I introduced on <tt>pkgs/top-level/all-packages.nix</tt>. Too bad I didn't still know how to test my changes:
* Here I would have detected the error I introduced on <tt>pkgs/top-level/all-packages.nix</tt>. Too bad I didn't still know how to test my changes:
<syntaxhighlight lang="console">
<syntaxhighlight lang="console">