mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-26 15:56:18 +02:00
d5ffc94f33
this makes the files in question a bit more independent of source location. to find where the value is set and how it's wired up: rg nix=doc/manual
45 lines
1.2 KiB
Nix
45 lines
1.2 KiB
Nix
let
|
|
inherit (builtins) attrValues mapAttrs;
|
|
inherit (import <nix/utils.nix>) concatStrings optionalString;
|
|
showSettings = import <nix/generate-settings.nix>;
|
|
in
|
|
|
|
inlineHTML: storesInfo:
|
|
|
|
let
|
|
|
|
showStore = name: { settings, doc, experimentalFeature }:
|
|
let
|
|
|
|
result = ''
|
|
## ${name}
|
|
|
|
${doc}
|
|
|
|
${experimentalFeatureNote}
|
|
|
|
### Settings
|
|
|
|
${showSettings { prefix = "store-${slug}"; inherit inlineHTML; } settings}
|
|
'';
|
|
|
|
# markdown doesn't like spaces in URLs
|
|
slug = builtins.replaceStrings [ " " ] [ "-" ] name;
|
|
|
|
experimentalFeatureNote = optionalString (experimentalFeature != null) ''
|
|
> **Warning**
|
|
> This store is part of an
|
|
> [experimental feature](@docroot@/contributing/experimental-features.md).
|
|
|
|
To use this store, you need to make sure the corresponding experimental feature,
|
|
[`${experimentalFeature}`](@docroot@/contributing/experimental-features.md#xp-feature-${experimentalFeature}),
|
|
is enabled.
|
|
For example, include the following in [`nix.conf`](#):
|
|
|
|
```
|
|
extra-experimental-features = ${experimentalFeature}
|
|
```
|
|
'';
|
|
in result;
|
|
|
|
in concatStrings (attrValues (mapAttrs showStore storesInfo))
|