2014-08-24 18:18:18 +01:00
|
|
|
|
<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">
|
2018-05-02 00:57:09 +01:00
|
|
|
|
<title>Package Management</title>
|
|
|
|
|
<para>
|
2019-09-19 18:17:30 +01:00
|
|
|
|
This section describes how to add additional packages to your system. NixOS
|
|
|
|
|
has two distinct styles of package management:
|
2018-05-02 00:57:09 +01:00
|
|
|
|
<itemizedlist>
|
|
|
|
|
<listitem>
|
|
|
|
|
<para>
|
2019-09-19 18:17:30 +01:00
|
|
|
|
<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.
|
2018-05-02 00:57:09 +01:00
|
|
|
|
</para>
|
|
|
|
|
</listitem>
|
|
|
|
|
<listitem>
|
|
|
|
|
<para>
|
2019-09-19 18:17:30 +01:00
|
|
|
|
<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.
|
2018-05-02 00:57:09 +01:00
|
|
|
|
</para>
|
|
|
|
|
</listitem>
|
|
|
|
|
</itemizedlist>
|
|
|
|
|
</para>
|
|
|
|
|
<xi:include href="declarative-packages.xml" />
|
|
|
|
|
<xi:include href="ad-hoc-packages.xml" />
|
2014-08-24 18:18:18 +01:00
|
|
|
|
</chapter>
|