From 0549b0c5f7343ecdd33d9febd53a11bebd15469f Mon Sep 17 00:00:00 2001 From: Abdirahman Osman Date: Fri, 3 Jul 2026 14:48:03 -0500 Subject: [PATCH] Add fetchurl multiple target urls docs --- lua/extensions.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lua/extensions.md b/lua/extensions.md index e442867..c2d6693 100644 --- a/lua/extensions.md +++ b/lua/extensions.md @@ -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.