From 5c99d24d1ecc148bb9cb3bea8beb5f9e1ee4388b Mon Sep 17 00:00:00 2001 From: laikq <55911173+laikq@users.noreply.github.com> Date: Fri, 25 Dec 2020 19:38:05 +0100 Subject: doc: explain where pkgs comes from in writing-modules The manual mentions how "[config and pkgs] are explained later". Added a link to where they are explained, and a hint pointing to the NIX_PATH variable. --- nixos/doc/manual/configuration/config-file.xml | 7 ++++--- nixos/doc/manual/development/writing-modules.xml | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'nixos/doc') diff --git a/nixos/doc/manual/configuration/config-file.xml b/nixos/doc/manual/configuration/config-file.xml index 7ccb5b3664e..19cfb57920d 100644 --- a/nixos/doc/manual/configuration/config-file.xml +++ b/nixos/doc/manual/configuration/config-file.xml @@ -16,9 +16,10 @@ The first line ({ config, pkgs, ... }:) denotes that this is actually a function that takes at least the two arguments config and pkgs. (These are explained - later.) The function returns a set of option definitions - ({ ... }). These definitions - have the form name = + later, in chapter ) The function returns + a set of option definitions ({ + ... }). These definitions have the form + name = value, where name is the name of an option and value is its value. For example, diff --git a/nixos/doc/manual/development/writing-modules.xml b/nixos/doc/manual/development/writing-modules.xml index d244356dbed..fad4637f51f 100644 --- a/nixos/doc/manual/development/writing-modules.xml +++ b/nixos/doc/manual/development/writing-modules.xml @@ -74,7 +74,10 @@ linkend="sec-configuration-syntax"/>, we saw the following structure This line makes the current Nix expression a function. The variable - pkgs contains Nixpkgs, while config + pkgs contains Nixpkgs (by default, it takes the + nixpkgs entry of NIX_PATH, see the Nix + manual for further details), while config contains the full system configuration. This line can be omitted if there is no reference to pkgs and config inside the module. -- cgit 1.4.1