From 0c3eca2682c1d38706f7ccaa8a8c77f1080d71ff Mon Sep 17 00:00:00 2001 From: Matthieu Coudron <886074+teto@users.noreply.github.com> Date: Thu, 22 Feb 2024 16:10:21 +0100 Subject: [PATCH] doc/fetchers: document downloadToTemp for fetchurl (#288762) * doc/fetchers: document downloadToTemp for fetchurl Co-authored-by: Valentin Gagarin --- doc/build-helpers/fetchers.chapter.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/build-helpers/fetchers.chapter.md b/doc/build-helpers/fetchers.chapter.md index 7bd1bbd6de02..ad2378fd0e74 100644 --- a/doc/build-helpers/fetchers.chapter.md +++ b/doc/build-helpers/fetchers.chapter.md @@ -80,6 +80,10 @@ stdenv.mkDerivation { The main difference between `fetchurl` and `fetchzip` is in how they store the contents. `fetchurl` will store the unaltered contents of the URL within the Nix store. `fetchzip` on the other hand, will decompress the archive for you, making files and directories directly accessible in the future. `fetchzip` can only be used with archives. Despite the name, `fetchzip` is not limited to .zip files and can also be used with any tarball. +Additional parameters to `fetchurl`: +- `downloadToTemp`: Defaults to `false`. If `true`, saves the source to `$downloadedFile`, to be used in conjunction with `postFetch` +- `postFetch`: Shell code executed after the file has been fetched successfully. Use it for postprocessing, to check or transform the file. + ## `fetchpatch` {#fetchpatch} `fetchpatch` works very similarly to `fetchurl` with the same arguments expected. It expects patch files as a source and performs normalization on them before computing the checksum. For example, it will remove comments or other unstable parts that are sometimes added by version control systems and can change over time.