2023-05-13 17:52:45 +00:00
|
|
|
let
|
|
|
|
inherit (builtins) concatStringsSep attrValues mapAttrs;
|
2023-11-30 20:41:47 +00:00
|
|
|
inherit (import <nix/utils.nix>) optionalString squash;
|
2023-05-13 17:52:45 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
builtinsInfo:
|
|
|
|
let
|
|
|
|
showBuiltin = name: { doc, type, impure-only }:
|
|
|
|
let
|
|
|
|
type' = optionalString (type != null) " (${type})";
|
|
|
|
|
|
|
|
impureNotice = optionalString impure-only ''
|
2023-07-20 08:27:38 +00:00
|
|
|
> **Note**
|
|
|
|
>
|
|
|
|
> Not available in [pure evaluation mode](@docroot@/command-ref/conf-file.md#conf-pure-eval).
|
2023-05-13 17:52:45 +00:00
|
|
|
'';
|
|
|
|
in
|
|
|
|
squash ''
|
2023-07-20 08:27:38 +00:00
|
|
|
<dt id="builtins-${name}">
|
|
|
|
<a href="#builtins-${name}"><code>${name}</code></a>${type'}
|
2023-05-13 17:52:45 +00:00
|
|
|
</dt>
|
|
|
|
<dd>
|
|
|
|
|
|
|
|
${doc}
|
|
|
|
|
|
|
|
${impureNotice}
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
concatStringsSep "\n" (attrValues (mapAttrs showBuiltin builtinsInfo))
|