at master 715 B view raw
1# To build this derivation, run `nix-build -A nixpkgs-manual.optionsDoc` 2{ lib, nixosOptionsDoc }: 3 4let 5 modules = lib.evalModules { 6 modules = [ ../../pkgs/top-level/config.nix ]; 7 class = "nixpkgsConfig"; 8 }; 9 10 root = toString ../..; 11 12 transformDeclaration = 13 decl: 14 let 15 declStr = toString decl; 16 subpath = lib.removePrefix "/" (lib.removePrefix root declStr); 17 in 18 assert lib.hasPrefix root declStr; 19 { 20 url = "https://github.com/NixOS/nixpkgs/blob/master/${subpath}"; 21 name = subpath; 22 }; 23in 24nixosOptionsDoc { 25 inherit (modules) options; 26 documentType = "none"; 27 transformOptions = opt: opt // { declarations = map transformDeclaration opt.declarations; }; 28}