Closed elkowar closed 4 years ago
with import <nixpkgs> {};
let
eval = import (pkgs.path + "/nixos/lib/eval-config.nix") { modules = []; };
opts = (nixosOptionsDoc { options = eval.options; }).optionsJSON;
in
runCommandLocal "options.json" { inherit opts; } "cp $opts/share/doc/nixos/options.json $out"
this generates the NixOS module documentation JSON, and home-manager json doc can be generated with nix-build -E '(import <home-manager> {}).docs.json'
Also: we should look at parsing the XML the nix documentation is generated from, to get documentation for the stdenv and lib functions. The additional information and cleanness available there would also allow me to provide much better autocompletion (as looking at the documentation gives me a full namespace that i can mach against, whereas the comments don't allow for that)
Both of this was implemented!
The data that the generated JSON documentation from options can provide should be used as a documentation source. This would imply: