antora-ui-default: init at 0

The Antora default UI bundle is intended to be passed to antora's
--ui-bundle-url flag or injected into the ui.bundle.url key to avoid
irreproducible [1] references.

This UI bundle allows writing reproducible Antora tests.

[1]: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/HEAD/raw/build/ui-bundle.zip?job=bundle-stable

Link: https://github.com/NixOS/nixpkgs/pull/332341

NAHO c5f5cc35 8d93801d

+79
+79
pkgs/by-name/an/antora-ui-default/package.nix
··· 1 + { 2 + fetchFromGitLab, 3 + lib, 4 + stdenvNoCC, 5 + }: 6 + let 7 + srcFetchFromGitLab = { 8 + hash = "sha256-q2FwkwzjanxTIxjMpCyMpzPt782uYZiWVdZ7Eev79oM="; 9 + owner = "trueNAHO"; 10 + repo = "antora-ui-default"; 11 + rev = "83bf9bf5f22a6dee397f8b089eb0315c14a278b5"; 12 + }; 13 + in 14 + stdenvNoCC.mkDerivation { 15 + pname = "antora-ui-default"; 16 + version = "0"; 17 + 18 + # The UI bundle is fetched from lib.maintainers.naho's antora-ui-default fork 19 + # for the following reasons: 20 + # 21 + # > The UI bundle is currently unpackaged [1] [2], and only accessible by 22 + # > fetching the latest GitLab artifact or building from source. Neither 23 + # > method is reliably reproducible, as artifacts are deleted over time and 24 + # > building from source requires insecure Node 10. 25 + # > 26 + # > The solution is to version control the UI bundle. 27 + # > 28 + # > [...] 29 + # > 30 + # > [1]: https://gitlab.com/antora/antora-ui-default/-/issues/135 31 + # > [2]: https://gitlab.com/antora/antora-ui-default/-/issues/211 32 + # > 33 + # > -- [3] 34 + # 35 + # To avoid bloating the repository archive size, the UI bundle is not stored 36 + # in Nixpkgs. 37 + # 38 + # For reference, the UI bundle from [3] is 300K large. 39 + # 40 + # [3]: https://gitlab.com/trueNAHO/antora-ui-default/-/commit/83bf9bf5f22a6dee397f8b089eb0315c14a278b5 41 + src = fetchFromGitLab srcFetchFromGitLab; 42 + 43 + phases = [ "installPhase" ]; 44 + 45 + # Install '$src/ui-bundle.zip' to '$out/ui-bundle.zip' instead of '$out' to 46 + # prevent the ZIP from being misidentified as a binary [1]. 47 + # 48 + # [1]: https://github.com/NixOS/nixpkgs/blob/8885a1e21ad43f8031c738a08029cd1d4dcbc2f7/pkgs/stdenv/generic/setup.sh#L792-L795 49 + installPhase = '' 50 + mkdir --parents "$out" 51 + cp "$src/ui-bundle.zip" "$out" 52 + ''; 53 + 54 + meta = { 55 + description = "Antora default UI bundle"; 56 + homepage = "https://gitlab.com/antora/antora-ui-default"; 57 + license = lib.licenses.mpl20; 58 + 59 + longDescription = '' 60 + > A UI bundle is a [ZIP 61 + > archive](https://en.wikipedia.org/wiki/Zip_(file_format)) or directory 62 + > that contains one or more UIs for a site. 63 + > 64 + > -- Antora 65 + > https://docs.antora.org/antora/3.1/playbook/ui-bundle-url 66 + 67 + This UI bundle is available under `$out/ui-bundle.zip` and intended to be 68 + passed to `antora`'s `--ui-bundle-url` flag or injected into the 69 + [`ui.bundle.url` 70 + key](https://docs.antora.org/antora/3.1/playbook/ui-bundle-url/#url-key) 71 + to avoid irreproducible 72 + [`https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/HEAD/raw/build/ui-bundle.zip?job=bundle-stable`](https://gitlab.com/${srcFetchFromGitLab.owner}/${srcFetchFromGitLab.repo}/-/blob/${srcFetchFromGitLab.rev}/README.adoc#user-content-use-the-default-ui) 73 + references. 74 + ''; 75 + 76 + maintainers = [ lib.maintainers.naho ]; 77 + platforms = lib.platforms.all; 78 + }; 79 + }