2021-04-12 05:27:59 +00:00
|
|
|
{ pkgs, lib, ... }:
|
|
|
|
let
|
|
|
|
singleDoc = name: value: ''
|
|
|
|
## ${name}
|
|
|
|
${value.description}
|
|
|
|
${lib.optionalString (value ? type) ''
|
|
|
|
*_Type_*:
|
|
|
|
${value.type}
|
|
|
|
''}
|
|
|
|
${lib.optionalString (value ? default) ''
|
|
|
|
*_Default_*
|
|
|
|
```
|
|
|
|
${builtins.toJSON value.default}
|
|
|
|
```
|
|
|
|
''}
|
|
|
|
${lib.optionalString (value ? example) ''
|
|
|
|
*_Example_*
|
|
|
|
```
|
|
|
|
${value.example}
|
|
|
|
```
|
|
|
|
''}
|
|
|
|
'';
|
|
|
|
|
|
|
|
options = (
|
2021-04-24 01:13:03 +00:00
|
|
|
lib.mkFlake.evalArgs { nixos = "nixos"; args = { }; }
|
2021-04-12 05:27:59 +00:00
|
|
|
).options;
|
|
|
|
|
|
|
|
processedOptions = (pkgs.nixosOptionsDoc { inherit options; }).optionsNix;
|
|
|
|
|
|
|
|
fullDoc = lib.concatStringsSep "" (lib.mapAttrsToList singleDoc processedOptions);
|
|
|
|
in
|
|
|
|
pkgs.writeText "devosOptions.md" fullDoc
|
|
|
|
|