From 8ce611b9fb664b6860b55f003d0b42a1dd0ab8e9 Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Wed, 8 Sep 2021 15:47:05 +0800 Subject: [PATCH] nixos: nixos/doc/manual/configuration/declarative-packages.xml to CommonMark --- .../declarative-packages.section.md | 46 ++++++++++++++++ .../configuration/declarative-packages.xml | 54 ------------------- .../doc/manual/configuration/package-mgmt.xml | 2 +- .../declarative-packages.section.xml | 53 ++++++++++++++++++ 4 files changed, 100 insertions(+), 55 deletions(-) create mode 100644 nixos/doc/manual/configuration/declarative-packages.section.md delete mode 100644 nixos/doc/manual/configuration/declarative-packages.xml create mode 100644 nixos/doc/manual/from_md/configuration/declarative-packages.section.xml diff --git a/nixos/doc/manual/configuration/declarative-packages.section.md b/nixos/doc/manual/configuration/declarative-packages.section.md new file mode 100644 index 000000000000..337cdf8472e4 --- /dev/null +++ b/nixos/doc/manual/configuration/declarative-packages.section.md @@ -0,0 +1,46 @@ +# Declarative Package Management {#sec-declarative-package-mgmt} + +With declarative package management, you specify which packages you want +on your system by setting the option +[](#opt-environment.systemPackages). For instance, adding the +following line to `configuration.nix` enables the Mozilla Thunderbird +email application: + +```nix +environment.systemPackages = [ pkgs.thunderbird ]; +``` + +The effect of this specification is that the Thunderbird package from +Nixpkgs will be built or downloaded as part of the system when you run +`nixos-rebuild switch`. + +::: {.note} +Some packages require additional global configuration such as D-Bus or +systemd service registration so adding them to +[](#opt-environment.systemPackages) might not be sufficient. You are +advised to check the [list of options](#ch-options) whether a NixOS +module for the package does not exist. +::: + +You can get a list of the available packages as follows: + +```ShellSession +$ nix-env -qaP '*' --description +nixos.firefox firefox-23.0 Mozilla Firefox - the browser, reloaded +... +``` + +The first column in the output is the *attribute name*, such as +`nixos.thunderbird`. + +Note: the `nixos` prefix tells us that we want to get the package from +the `nixos` channel and works only in CLI tools. In declarative +configuration use `pkgs` prefix (variable). + +To "uninstall" a package, simply remove it from +[](#opt-environment.systemPackages) and run `nixos-rebuild switch`. + +```{=docbook} + + +``` diff --git a/nixos/doc/manual/configuration/declarative-packages.xml b/nixos/doc/manual/configuration/declarative-packages.xml deleted file mode 100644 index 8d321929f3f0..000000000000 --- a/nixos/doc/manual/configuration/declarative-packages.xml +++ /dev/null @@ -1,54 +0,0 @@ -
- Declarative Package Management - - - With declarative package management, you specify which packages you want on - your system by setting the option - . For instance, adding the - following line to configuration.nix enables the Mozilla - Thunderbird email application: - - = [ pkgs.thunderbird ]; - - The effect of this specification is that the Thunderbird package from Nixpkgs - will be built or downloaded as part of the system when you run - nixos-rebuild switch. - - - - - Some packages require additional global configuration such as D-Bus or systemd service registration so adding them to might not be sufficient. You are advised to check the list of options whether a NixOS module for the package does not exist. - - - - - You can get a list of the available packages as follows: - -$ nix-env -qaP '*' --description -nixos.firefox firefox-23.0 Mozilla Firefox - the browser, reloaded -... - - The first column in the output is the attribute name, - such as nixos.thunderbird. - - - Note: the nixos prefix tells us that we want to get the - package from the nixos channel and works only in CLI tools. - - In declarative configuration use pkgs prefix (variable). - - - - To “uninstall” a package, simply remove it from - and run - nixos-rebuild switch. - - - - - -
diff --git a/nixos/doc/manual/configuration/package-mgmt.xml b/nixos/doc/manual/configuration/package-mgmt.xml index 2f9395d26fa8..499926ea50b4 100644 --- a/nixos/doc/manual/configuration/package-mgmt.xml +++ b/nixos/doc/manual/configuration/package-mgmt.xml @@ -26,6 +26,6 @@ - + diff --git a/nixos/doc/manual/from_md/configuration/declarative-packages.section.xml b/nixos/doc/manual/from_md/configuration/declarative-packages.section.xml new file mode 100644 index 000000000000..da31f18d9233 --- /dev/null +++ b/nixos/doc/manual/from_md/configuration/declarative-packages.section.xml @@ -0,0 +1,53 @@ +
+ Declarative Package Management + + With declarative package management, you specify which packages you + want on your system by setting the option + . For instance, + adding the following line to configuration.nix + enables the Mozilla Thunderbird email application: + + +environment.systemPackages = [ pkgs.thunderbird ]; + + + The effect of this specification is that the Thunderbird package + from Nixpkgs will be built or downloaded as part of the system when + you run nixos-rebuild switch. + + + + Some packages require additional global configuration such as + D-Bus or systemd service registration so adding them to + might not be + sufficient. You are advised to check the + list of options whether a NixOS + module for the package does not exist. + + + + You can get a list of the available packages as follows: + + +$ nix-env -qaP '*' --description +nixos.firefox firefox-23.0 Mozilla Firefox - the browser, reloaded +... + + + The first column in the output is the attribute + name, such as nixos.thunderbird. + + + Note: the nixos prefix tells us that we want to + get the package from the nixos channel and works + only in CLI tools. In declarative configuration use + pkgs prefix (variable). + + + To uninstall a package, simply remove it from + and run + nixos-rebuild switch. + + + +