diff options
author | laikq <55911173+laikq@users.noreply.github.com> | 2020-12-25 19:38:05 +0100 |
---|---|---|
committer | tomberek <tomberek@users.noreply.github.com> | 2021-03-03 11:09:21 -0500 |
commit | 5c99d24d1ecc148bb9cb3bea8beb5f9e1ee4388b (patch) | |
tree | 518c5e624aca082725dc0afb4e405401ddde43b5 /nixos | |
parent | 9004162c264173beddb8308a2533fa08c8ca24ca (diff) |
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.
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/doc/manual/configuration/config-file.xml | 7 | ||||
-rw-r--r-- | nixos/doc/manual/development/writing-modules.xml | 5 |
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 7ccb5b3664ea..19cfb57920df 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 d244356dbed1..fad4637f51f0 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. |