summary refs log tree commit diff
diff options
context:
space:
mode:
authorlaikq <55911173+laikq@users.noreply.github.com>2020-12-25 19:38:05 +0100
committertomberek <tomberek@users.noreply.github.com>2021-03-03 11:09:21 -0500
commit5c99d24d1ecc148bb9cb3bea8beb5f9e1ee4388b (patch)
tree518c5e624aca082725dc0afb4e405401ddde43b5
parent9004162c264173beddb8308a2533fa08c8ca24ca (diff)
downloadnixpkgs-5c99d24d1ecc148bb9cb3bea8beb5f9e1ee4388b.tar
nixpkgs-5c99d24d1ecc148bb9cb3bea8beb5f9e1ee4388b.tar.gz
nixpkgs-5c99d24d1ecc148bb9cb3bea8beb5f9e1ee4388b.tar.bz2
nixpkgs-5c99d24d1ecc148bb9cb3bea8beb5f9e1ee4388b.tar.lz
nixpkgs-5c99d24d1ecc148bb9cb3bea8beb5f9e1ee4388b.tar.xz
nixpkgs-5c99d24d1ecc148bb9cb3bea8beb5f9e1ee4388b.tar.zst
nixpkgs-5c99d24d1ecc148bb9cb3bea8beb5f9e1ee4388b.zip
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.
-rw-r--r--nixos/doc/manual/configuration/config-file.xml7
-rw-r--r--nixos/doc/manual/development/writing-modules.xml5
2 files changed, 8 insertions, 4 deletions
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 (<literal>{ config, pkgs, ... }:</literal>) denotes that this
   is actually a function that takes at least the two arguments
   <varname>config</varname> and <varname>pkgs</varname>. (These are explained
-  later.) The function returns a <emphasis>set</emphasis> of option definitions
-  (<literal>{ <replaceable>...</replaceable> }</literal>). These definitions
-  have the form <literal><replaceable>name</replaceable> =
+  later, in chapter <xref linkend="sec-writing-modules" />) The function returns
+  a <emphasis>set</emphasis> of option definitions (<literal>{
+  <replaceable>...</replaceable> }</literal>). These definitions have the form
+  <literal><replaceable>name</replaceable> =
   <replaceable>value</replaceable></literal>, where
   <replaceable>name</replaceable> is the name of an option and
   <replaceable>value</replaceable> 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
    <callout arearefs='module-syntax-1'>
     <para>
      This line makes the current Nix expression a function. The variable
-     <varname>pkgs</varname> contains Nixpkgs, while <varname>config</varname>
+     <varname>pkgs</varname> contains Nixpkgs (by default, it takes the
+     <varname>nixpkgs</varname> entry of <envar>NIX_PATH</envar>, see the <link
+     xlink:href="https://nixos.org/manual/nix/stable/#sec-common-env">Nix
+     manual</link> for further details), while <varname>config</varname>
      contains the full system configuration. This line can be omitted if there
      is no reference to <varname>pkgs</varname> and <varname>config</varname>
      inside the module.