1# Declarative Package Management {#sec-declarative-package-mgmt}
2
3With declarative package management, you specify which packages you want
4on your system by setting the option
5[](#opt-environment.systemPackages). For instance, adding the
6following line to `configuration.nix` enables the Mozilla Thunderbird
7email application:
8
9```nix
10environment.systemPackages = [ pkgs.thunderbird ];
11```
12
13The effect of this specification is that the Thunderbird package from
14Nixpkgs will be built or downloaded as part of the system when you run
15`nixos-rebuild switch`.
16
17::: {.note}
18Some packages require additional global configuration such as D-Bus or
19systemd service registration so adding them to
20[](#opt-environment.systemPackages) might not be sufficient. You are
21advised to check the [list of options](#ch-options) whether a NixOS
22module for the package does not exist.
23:::
24
25You can get a list of the available packages as follows:
26
27```ShellSession
28$ nix-env -qaP '*' --description
29nixos.firefox firefox-23.0 Mozilla Firefox - the browser, reloaded
30...
31```
32
33The first column in the output is the *attribute name*, such as
34`nixos.thunderbird`.
35
36Note: the `nixos` prefix tells us that we want to get the package from
37the `nixos` channel and works only in CLI tools. In declarative
38configuration use `pkgs` prefix (variable).
39
40To "uninstall" a package, simply remove it from
41[](#opt-environment.systemPackages) and run `nixos-rebuild switch`.
42
43```{=docbook}
44<xi:include href="customizing-packages.section.xml" />
45<xi:include href="adding-custom-packages.section.xml" />
46```