mirror of
https://github.com/tale/headplane.git
synced 2026-07-26 15:58:14 +00:00
fdbfe584c5
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.
25 lines
468 B
Nix
25 lines
468 B
Nix
{
|
|
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"
|