about summary refs log tree commit diff
path: root/doc/manual/expressions/builtins.xml
diff options
context:
space:
mode:
authorFrederik Rietdijk <freddyrietdijk@fridh.nl>2017-05-11T11·38+0200
committerGitHub <noreply@github.com>2017-05-11T11·38+0200
commit2b2de5ef6aeb023f22e551e74e454acc73106cc8 (patch)
tree39fa8dec834fc554e2822f8c57000683a5a89696 /doc/manual/expressions/builtins.xml
parent1fd59447d56a88add8874f9a8b0885a1acd13606 (diff)
Document fetchTarball can take a sha256
Note that I refer to `nix-prefetch-url`.
Diffstat (limited to 'doc/manual/expressions/builtins.xml')
-rw-r--r--doc/manual/expressions/builtins.xml18
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/manual/expressions/builtins.xml b/doc/manual/expressions/builtins.xml
index 63d13e184a12..e9c641ab305a 100644
--- a/doc/manual/expressions/builtins.xml
+++ b/doc/manual/expressions/builtins.xml
@@ -292,6 +292,24 @@ with import (fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixo
 stdenv.mkDerivation { … }
 </programlisting>
 
+    Note that when obtaining the hash with <varname>nix-prefetch-url
+    </varname> the option <varname>--unpack</varname> is required.
+    </para> 
+      
+    <para>This function can also verify the contents against a hash. 
+    In that case, the function takes a set instead of a URL. The set 
+    requires the attribute <varname>url</varname> and the attribute
+    <varname>sha256</varname>, e.g.
+      
+<programlisting>
+with import (fetchTarball {
+  url = https://github.com/NixOS/nixpkgs-channels/archive/nixos-14.12.tar.gz;
+  sha256 = "1jppksrfvbk5ypiqdz4cddxdl8z6zyzdb2srq8fcffr327ld5jj2";
+}) {};
+
+stdenv.mkDerivation { … }
+</programlisting>
+      
     </para>
 
     <para>This function is not available if <link