# Pastebin Yxtpi8bw with builtins; let lib = (import {}).lib; options = (import {}).options; optionsList = lib.filter (opt: opt.visible && !opt.internal) (lib.optionAttrSetToDocList options); substFunction = x: if isAttrs x then lib.mapAttrs (name: substFunction) x else if isList x then map substFunction x else if isFunction x then "" else x; optionsList' = lib.flip map optionsList (opt: opt // { declarations = map stripAnyPrefixes opt.declarations; } // lib.optionalAttrs (opt ? example) { example = substFunction opt.example; } // lib.optionalAttrs (opt ? default) { default = substFunction opt.default; } // lib.optionalAttrs (opt ? type) { type = substFunction opt.type; }); prefixesToStrip = map (p: "${toString p}/") ([ ../../.. ]); stripAnyPrefixes = lib.flip (lib.fold lib.removePrefix) prefixesToStrip; in listToAttrs (map (o: { name = o.name; value = removeAttrs o ["name" "visible" "internal"]; }) optionsList')