feat: nix: add a new mise task and nix flake output to generate NixOS docs
Adds a new Nix flake output `headplane-nixos-docs` which generates a Markdown page with all NixOS `services.headplane.settings.*` options. Replaces existing handwritten options documentation.
This commit is contained in:
parent
cdcb38f11e
commit
fdbfe584c5
7 changed files with 1331 additions and 482 deletions
24
nix/docs.nix
Normal file
24
nix/docs.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
lib,
|
||||
nixosOptionsDoc,
|
||||
runCommand,
|
||||
...
|
||||
}: let
|
||||
eval = lib.evalModules {
|
||||
modules = [./options.nix];
|
||||
};
|
||||
transformOptions = opt:
|
||||
if (lib.hasPrefix "_" opt.name)
|
||||
then
|
||||
opt
|
||||
// {
|
||||
internal = true;
|
||||
visible = false;
|
||||
}
|
||||
else opt;
|
||||
optionsDoc = nixosOptionsDoc {
|
||||
inherit (eval) options;
|
||||
inherit transformOptions;
|
||||
};
|
||||
in
|
||||
runCommand "headplane-nixos-docs.md" {} "cat ${optionsDoc.optionsCommonMark} > $out"
|
||||
Loading…
Add table
Add a link
Reference in a new issue