at 18.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 <title>Declarative Package Management</title> 7 8 <para> 9 With declarative package management, you specify which packages you want on 10 your system by setting the option 11 <xref linkend="opt-environment.systemPackages"/>. For instance, adding the 12 following line to <filename>configuration.nix</filename> enables the Mozilla 13 Thunderbird email application: 14<programlisting> 15<xref linkend="opt-environment.systemPackages"/> = [ pkgs.thunderbird ]; 16</programlisting> 17 The effect of this specification is that the Thunderbird package from Nixpkgs 18 will be built or downloaded as part of the system when you run 19 <command>nixos-rebuild switch</command>. 20 </para> 21 22 <para> 23 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 The first column in the output is the <emphasis>attribute name</emphasis>, 30 such as <literal>nixos.thunderbird</literal>. (The <literal>nixos</literal> 31 prefix allows distinguishing between different channels that you might have.) 32 </para> 33 34 <para> 35 To “uninstall” a package, simply remove it from 36 <xref linkend="opt-environment.systemPackages"/> and run 37 <command>nixos-rebuild switch</command>. 38 </para> 39 40 <xi:include href="customizing-packages.xml" /> 41 42 <xi:include href="adding-custom-packages.xml" /> 43</section>