2023-09-07 01:31:33 +03:00
|
|
|
let
|
|
|
|
inherit (builtins) attrValues mapAttrs;
|
2023-11-30 22:59:08 +02:00
|
|
|
inherit (import <nix/utils.nix>) concatStrings optionalString squash;
|
2023-11-30 22:41:47 +02:00
|
|
|
showSettings = import <nix/generate-settings.nix>;
|
2023-09-07 01:31:33 +03:00
|
|
|
in
|
|
|
|
|
2023-10-05 02:20:26 +03:00
|
|
|
inlineHTML: storesInfo:
|
2023-09-07 01:31:33 +03:00
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
showStore = name: { settings, doc, experimentalFeature }:
|
|
|
|
let
|
2023-11-30 22:59:08 +02:00
|
|
|
result = squash ''
|
|
|
|
# ${name}
|
2023-09-07 01:31:33 +03:00
|
|
|
|
2023-11-30 22:59:08 +02:00
|
|
|
${doc}
|
2023-09-07 01:31:33 +03:00
|
|
|
|
2023-11-30 22:59:08 +02:00
|
|
|
${experimentalFeatureNote}
|
2023-09-07 01:31:33 +03:00
|
|
|
|
2023-11-30 22:59:08 +02:00
|
|
|
## Settings
|
2023-09-07 01:31:33 +03:00
|
|
|
|
2023-11-30 22:59:08 +02:00
|
|
|
${showSettings { prefix = "store-${slug}"; inherit inlineHTML; } settings}
|
|
|
|
'';
|
2023-09-07 01:31:33 +03:00
|
|
|
|
|
|
|
# markdown doesn't like spaces in URLs
|
|
|
|
slug = builtins.replaceStrings [ " " ] [ "-" ] name;
|
|
|
|
|
2023-11-30 22:59:08 +02:00
|
|
|
experimentalFeatureNote = optionalString (experimentalFeature != null) ''
|
|
|
|
> **Warning**
|
|
|
|
>
|
|
|
|
> This store is part of an
|
|
|
|
> [experimental feature](@docroot@/contributing/experimental-features.md).
|
|
|
|
>
|
|
|
|
> To use this store, make sure the
|
|
|
|
> [`${experimentalFeature}` experimental feature](@docroot@/contributing/experimental-features.md#xp-feature-${experimentalFeature})
|
|
|
|
> is enabled.
|
|
|
|
> For example, include the following in [`nix.conf`](@docroot@/command-ref/conf-file.md):
|
|
|
|
>
|
|
|
|
> ```
|
|
|
|
> extra-experimental-features = ${experimentalFeature}
|
|
|
|
> ```
|
|
|
|
'';
|
|
|
|
in result;
|
2023-09-07 01:31:33 +03:00
|
|
|
|
|
|
|
in concatStrings (attrValues (mapAttrs showStore storesInfo))
|