How is the NixOS module documentation generated?

So I see that the mkOption function has a documentation field, and that the manual and are generated from them. I’m wanting to integrate the documentation into a project I’m working on , but I can’t quite figure out how the documentation fields are actually consumed by these tools. Does anyone have any idea?

You could use the function pkgs.nixosOptionsDoc to generate various files containing option descriptions. There are also some documentation in

You may want to have a look at nmd. It is a standalone version of the NixOS documentation system that I put together for Home Manager and my NUR, with some additions to support AsciiDoc.


Are you looking for the import scripts for They’re here: nixos-search/ at 7c89b2349cfb7e9d7374bebdbff5b592ff5f0802 · NixOS/nixos-search · GitHub

Thanks everyone for the pointers. My goal is to generate an interactive nix module editor that provides structured editing and help for options as you’re editing. This will help me get all the option data in one place.