summary refs log tree commit diff
path: root/nixos/doc/manual/configuration/package-mgmt.xml
blob: 499926ea50b4b4161e39be3819c8b2674bb88d22 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<chapter xmlns="http://docbook.org/ns/docbook"
         xmlns:xlink="http://www.w3.org/1999/xlink"
         xmlns:xi="http://www.w3.org/2001/XInclude"
         version="5.0"
         xml:id="sec-package-management">
 <title>Package Management</title>
 <para>
  This section describes how to add additional packages to your system. NixOS
  has two distinct styles of package management:
  <itemizedlist>
   <listitem>
    <para>
     <emphasis>Declarative</emphasis>, where you declare what packages you want
     in your <filename>configuration.nix</filename>. Every time you run
     <command>nixos-rebuild</command>, NixOS will ensure that you get a
     consistent set of binaries corresponding to your specification.
    </para>
   </listitem>
   <listitem>
    <para>
     <emphasis>Ad hoc</emphasis>, where you install, upgrade and uninstall
     packages via the <command>nix-env</command> command. This style allows
     mixing packages from different Nixpkgs versions. It’s the only choice
     for non-root users.
    </para>
   </listitem>
  </itemizedlist>
 </para>
 <xi:include href="../from_md/configuration/declarative-packages.section.xml" />
 <xi:include href="../from_md/configuration/ad-hoc-packages.section.xml" />
</chapter>