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