about summary refs log tree commit diff
path: root/doc/manual
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2004-10-25T16·54+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2004-10-25T16·54+0000
commit37d7abd69402f0e7a78d4d2f2d78996409a8563a (patch)
treebf844e4486b0e055921583c4b7c2d3d843b34485 /doc/manual
parentf4d44a002688262d33093494a7fea1bb11b97ac9 (diff)
* New language feature: with expressions.
  The expression `with E1; E2' evaluates to E2 with all bindings in
  the attribute set E1 substituted.  E.g.,

    with {x = 123;}; x

  evaluates to 123.  That is, the attribute set E1 is in scope in E2.

  This is particularly useful when importing files containing lots
  definitions.  E.g., instead of

    let {
      inherit (import ./foo.nix) a b c d e f;

      body = ... a ... f ...;
    }

  we can now say

    with import ./foo.nix;

    ... a ... f ...

  I.e., we don't have to say what variables should be brought into scope.

Diffstat (limited to 'doc/manual')
-rw-r--r--doc/manual/package-management.xml34
1 files changed, 21 insertions, 13 deletions
diff --git a/doc/manual/package-management.xml b/doc/manual/package-management.xml
index 470cb80a09e1..b717844b1141 100644
--- a/doc/manual/package-management.xml
+++ b/doc/manual/package-management.xml
@@ -17,18 +17,12 @@ available for installation.</para>
 <para>In Nix, different users can have different <quote>views</quote>
 on the set of installed applications.  That is, there might be lots of
 applications present on the system (possibly in many different
-versions), but users can have a specific selection of those
-active — where <quote>active</quote> just means that it appears
-in a directory in the user's <envar>PATH</envar>.</para>
-
-<para>Such a view on the set of installed applications is called a
-<emphasis>user environment</emphasis>, which is just a directory tree
-consisting of symlinks to the files of the active applications.  In
-Nix, operations such as upgrading or removing components never
-overwrite or remove the files of those components, and they don't even
-touch the user environments that point to them.  Rather, they cause a
-<emphasis>new</emphasis> user environment to be constructed based on
-the old one.</para>
+versions), but users can have a specific selection of those active —
+where <quote>active</quote> just means that it appears in a directory
+in the user's <envar>PATH</envar>.  Such a view on the set of
+installed applications is called a <emphasis>user
+environment</emphasis>, which is just a directory tree consisting of
+symlinks to the files of the active applications.  </para>
 
 <para>Components are installed from a set of <emphasis>Nix
 expressions</emphasis> that tell Nix how to build those components,
@@ -168,7 +162,21 @@ set.</para></footnote></para>
 
 <sect1><title>Profiles</title>
 
-<para>Bla</para>
+<para>In Nix, operations such as upgrading or removing components
+never overwrite or remove the files of those components, and they
+don't even touch the user environments that point to them.  Rather,
+they cause a <emphasis>new</emphasis> user environment to be
+constructed based on the old one.  This is illustrated in Figure
+bla.</para>
+
+<figure><title>User environments</title>
+  <mediaobject>
+    <imageobject>
+      <imagedata fileref='figures/userenv-frame3.png' format='PNG' />
+    </imageobject>
+  </mediaobject>
+</figure>
+
 
 </sect1>