diff --git a/doc/manual/nix-prefetch-url.xml b/doc/manual/nix-prefetch-url.xml
index a6b3711e3..a0d5a97f1 100644
--- a/doc/manual/nix-prefetch-url.xml
+++ b/doc/manual/nix-prefetch-url.xml
@@ -1,54 +1,69 @@
-
- nix-prefetch-url
- copy a file from a URL into the store and print its MD5 hash
-
+
+
+ nix-prefetch-url
+ copy a file from a URL into the store and print its MD5 hash
+
-
-
- nix-prefetch-url
- url
-
-
+
+
+ nix-prefetch-url
+ url
+ hash
+
+
-
- Description
-
- The command nix-prefetch-url downloads the
- file referenced by the URL url,
- prints its MD5 cryptographic hash code, and copies it into the
- Nix store. The file name in the store is
- hash-basename,
- where basename is everything
- following the final slash in url.
-
+Description
-
- This command is just a convenience to Nix expression writers.
- Often a Nix expressions fetch some source distribution from the
- network using the fetchurl expression
- contained in nixpkgs. However,
- fetchurl requires an MD5 hash. If you don't
- know the hash, you would have to download the file first, and
- then fetchurl would download it again when
- you build your Nix expression. Since
- fetchurl uses the same name for the
- downloaded file as nix-prefetch-url, the
- redundant download can be avoided.
-
+The command nix-prefetch-url downloads the
+file referenced by the URL url, prints its
+cryptographic hash, and copies it into the Nix store. The file name
+in the store is
+hash-baseName,
+where baseName is everything following the
+final slash in url.
-
+This command is just a convenience for Nix expression writers.
+Often a Nix expression fetches some source distribution from the
+network using the fetchurl expression contained in
+Nixpkgs. However, fetchurl requires a
+cryptographic hash. If you don't know the hash, you would have to
+download the file first, and then fetchurl would
+download it again when you build your Nix expression. Since
+fetchurl uses the same name for the downloaded file
+as nix-prefetch-url, the redundant download can be
+avoided.
-
- Examples
+The environment variable NIX_HASH_ALGO specifies
+which hash algorithm to use. It can be either md5,
+sha1, or sha256. The default is
+md5.
-
+If hash is specified, then a download
+is not performed if the Nix store already contains a file with the
+same hash and base name. Otherwise, the file is downloaded, and an
+error if signaled if the actual hash of the file does not match the
+specified hash.
+
+This command prints the hash on standard output. Additionally,
+if the environment variable PRINT_PATH is set, the path
+of the downloaded file in the Nix store is also printed.
+
+
+
+
+Examples
+
+
$ nix-prefetch-url ftp://ftp.nluug.nl/pub/gnu/make/make-3.80.tar.bz2
-...
-file has hash 0bbd1df101bc0294d440471e50feca71
-...
+0bbd1df101bc0294d440471e50feca71
+
+$ PRINT_PATH=1 nix-prefetch-url ftp://ftp.nluug.nl/pub/gnu/make/make-3.80.tar.bz2
+0bbd1df101bc0294d440471e50feca71
+/nix/store/wvyz8ifdn7wyz1p3pqyn0ra45ka2l492-make-3.80.tar.bz2
+
+
-
diff --git a/doc/manual/nix-store.xml b/doc/manual/nix-store.xml
index c67e20266..0fec253bd 100644
--- a/doc/manual/nix-store.xml
+++ b/doc/manual/nix-store.xml
@@ -189,7 +189,7 @@ linkend="sec-nix-build">nix-build does.
nix-store
-
+
@@ -451,7 +451,7 @@ most one query can be specified. The default query is
nix-store
-
+
@@ -473,7 +473,7 @@ most one query can be specified. The default query is
nix-store
-
+ srcpathsubpath
@@ -501,7 +501,8 @@ deployment.
Synopsisnix-store
-
+
+
@@ -514,6 +515,25 @@ automatically repaired. Inconsistencies are generally the result of
the Nix store or database being modified by non-Nix tools, or of bugs
in Nix itself.
+There is one option:
+
+
+
+
+
+ Checks that the contents of every valid store path
+ has not been altered by computing a SHA-256 hash of the contents
+ and comparing it with the hash stored in the Nix database at build
+ time. Paths that have been modified are printed out. For large
+ stores, is obviously quite
+ slow.
+
+
+
+
+
+
+