2021-04-12 07:27:59 +02: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 03:13:03 +02:00
|
|
|
lib.mkFlake.evalArgs { nixos = "nixos"; args = { }; }
|
2021-04-12 07:27:59 +02:00
|
|
|
).options;
|
|
|
|
|
|
|
|
processedOptions = (pkgs.nixosOptionsDoc { inherit options; }).optionsNix;
|
|
|
|
|
|
|
|
fullDoc = lib.concatStringsSep "" (lib.mapAttrsToList singleDoc processedOptions);
|
|
|
|
in
|
|
|
|
pkgs.writeText "devosOptions.md" fullDoc
|
|
|
|
|