diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2017-05-24 11:07:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-24 11:07:36 +0200 |
commit | b303ad012cc4fa9d4fc947191e685eaef45fb6ed (patch) | |
tree | 162562ffe9f218585ceedc20b2d8e323a5ff8c20 /doc/manual | |
parent | edbb105e98b1d2c54776e91b49984eb50cce9db4 (diff) | |
parent | 2b2de5ef6aeb023f22e551e74e454acc73106cc8 (diff) |
Merge pull request #1382 from FRidh/patch-1
Document fetchTarball can take a sha256
Diffstat (limited to 'doc/manual')
-rw-r--r-- | doc/manual/expressions/builtins.xml | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/manual/expressions/builtins.xml b/doc/manual/expressions/builtins.xml index 8a3266106..f46a93ae0 100644 --- a/doc/manual/expressions/builtins.xml +++ b/doc/manual/expressions/builtins.xml @@ -298,6 +298,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 |