at 16.09-beta 1.6 kB view raw
1<section xmlns="http://docbook.org/ns/docbook" 2 xmlns:xlink="http://www.w3.org/1999/xlink" 3 xmlns:xi="http://www.w3.org/2001/XInclude" 4 version="5.0" 5 xml:id="sec-declarative-package-mgmt"> 6 7<title>Declarative Package Management</title> 8 9<para>With declarative package management, you specify which packages 10you want on your system by setting the option 11<option>environment.systemPackages</option>. For instance, adding the 12following line to <filename>configuration.nix</filename> enables the 13Mozilla Thunderbird email application: 14 15<programlisting> 16environment.systemPackages = [ pkgs.thunderbird ]; 17</programlisting> 18 19The effect of this specification is that the Thunderbird package from 20Nixpkgs will be built or downloaded as part of the system when you run 21<command>nixos-rebuild switch</command>.</para> 22 23<para>You can get a list of the available packages as follows: 24<screen> 25$ nix-env -qaP '*' --description 26nixos.firefox firefox-23.0 Mozilla Firefox - the browser, reloaded 27<replaceable>...</replaceable> 28</screen> 29 30The first column in the output is the <emphasis>attribute 31name</emphasis>, such as 32<literal>nixos.thunderbird</literal>. (The 33<literal>nixos</literal> prefix allows distinguishing between 34different channels that you might have.)</para> 35 36<para>To “uninstall” a package, simply remove it from 37<option>environment.systemPackages</option> and run 38<command>nixos-rebuild switch</command>.</para> 39 40<xi:include href="customizing-packages.xml" /> 41<xi:include href="adding-custom-packages.xml" /> 42 43</section>