about summary refs log tree commit diff
diff options
context:
space:
mode:
authorErsin Akinci <me@ersinakinci.com>2019-10-21T02·08-0700
committerEelco Dolstra <edolstra@gmail.com>2020-01-04T12·40+0100
commitc7b4bf1c9cb830e15d517e3cb2b214ea838530b4 (patch)
treea6127e896bdd670da8f234cc83ff5767bb68a3af
parenta53e4e217bffd5d675dd0a3ea684131947c9c1fb (diff)
Document import <path> syntax
(cherry picked from commit d8730fb86facadbef22d3df7f8a743a56e7ed53c)
-rw-r--r--doc/manual/expressions/builtins.xml10
1 files changed, 9 insertions, 1 deletions
diff --git a/doc/manual/expressions/builtins.xml b/doc/manual/expressions/builtins.xml
index 465fa1e0b001..21da8b87b284 100644
--- a/doc/manual/expressions/builtins.xml
+++ b/doc/manual/expressions/builtins.xml
@@ -733,13 +733,21 @@ builtins.genList (x: x * x) 5
   <varlistentry xml:id='builtin-import'>
     <term><function>import</function>
     <replaceable>path</replaceable></term>
+    <term><function>import</function>
+    <replaceable>&lt;path&gt;</replaceable></term>
     <term><function>builtins.import</function>
     <replaceable>path</replaceable></term>
+    <term><function>builtins.import</function>
+    <replaceable>&lt;path&gt;</replaceable></term>
 
     <listitem><para>Load, parse and return the Nix expression in the
     file <replaceable>path</replaceable>.  If <replaceable>path
     </replaceable> is a directory, the file <filename>default.nix
-    </filename> in that directory is loaded.  Evaluation aborts if the
+    </filename> in that directory is loaded.  If the <replaceable>
+    &lt;path&gt;</replaceable> syntax is used, the path will be resolved
+    relative to those listed in the <envar>NIX_PATH</envar> environment
+    variable (see the section on <envar linkend="env-NIX_PATH">NIX_PATH</envar>
+    for details on how the resolution works). Evaluation aborts if the
     file doesn’t exist or contains an incorrect Nix expression.
     <function>import</function> implements Nix’s module system: you
     can put any Nix expression (such as a set or a function) in a