Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lua/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,21 @@ The environment that the builder runs in is documented in the [Derivation Specif

[Derivation Specification]: ../derivations.md

:::{function} fetchurl{url, hash, [name], [executable]}
:::{function} fetchurl{hash, [name], [executable], [url], [urls]}

`fetchurl` returns a derivation that downloads a URL.
`fetchurl` takes a table as its sole argument
with the following fields:

:kwparam string url: The URL to download.
:kwparam string url: The URL to download. Either `url` or `urls` must be specified. If both `url` and `urls` are defiend then `url` is tried first.

:kwparam string[] urls: A list of URLs to download from. Each URL is tried in order until one succeeds. Either `url` or `urls` must be specified. If both `url` and `urls` are defiend then `url` is tried first.

:kwparam string hash: A [hash string](hash-string.md) of the file's content.

:kwparam string name:
The name to use for the store object (excluding the digest).
If omitted, then the last path component of the `url` is used as the name.
If omitted, then the last path component of the `url` is used as the name otherwise the head of `urls` is used instead.

:kwparam boolean executable:
Whether the file should be marked as executable.
Expand Down