diff options
author | Graham Christensen <graham@grahamc.com> | 2017-12-23 07:19:45 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-23 07:19:45 -0500 |
commit | b5a61f2c599ac665e3c3129258ea8671cb5760af (patch) | |
tree | ac16b806bfd54846edba76b0f21ff5d929570ff4 /nixos/doc/manual/default.nix | |
parent | d3a0eb320a5e28a19b82f813e001fa832d7ef1d3 (diff) | |
download | nixpkgs-b5a61f2c599ac665e3c3129258ea8671cb5760af.tar nixpkgs-b5a61f2c599ac665e3c3129258ea8671cb5760af.tar.gz nixpkgs-b5a61f2c599ac665e3c3129258ea8671cb5760af.tar.bz2 nixpkgs-b5a61f2c599ac665e3c3129258ea8671cb5760af.tar.lz nixpkgs-b5a61f2c599ac665e3c3129258ea8671cb5760af.tar.xz nixpkgs-b5a61f2c599ac665e3c3129258ea8671cb5760af.tar.zst nixpkgs-b5a61f2c599ac665e3c3129258ea8671cb5760af.zip |
Revert "nixos: doc: implement related packages in the manual"
Diffstat (limited to 'nixos/doc/manual/default.nix')
-rw-r--r-- | nixos/doc/manual/default.nix | 34 |
1 files changed, 3 insertions, 31 deletions
diff --git a/nixos/doc/manual/default.nix b/nixos/doc/manual/default.nix index 95363c2458f..9bc83be6610 100644 --- a/nixos/doc/manual/default.nix +++ b/nixos/doc/manual/default.nix @@ -15,27 +15,13 @@ let else if builtins.isFunction x then "<function>" else x; - # Generate DocBook documentation for a list of packages - genRelatedPackages = packages: - let - unpack = p: if lib.isString p then { name = p; } else p; - describe = { name, package ? pkgs.${name}, comment ? "" }: - "<listitem>" - + "<para><option>pkgs.${name}</option> (${package.name}): ${package.meta.description or "???"}.</para>" - + lib.optionalString (comment != "") "\n<para>${comment}</para>" - # Lots of `longDescription's break DocBook, so we just wrap them into <programlisting> - + lib.optionalString (package.meta ? longDescription) "\n<programlisting>${package.meta.longDescription}</programlisting>" - + "</listitem>"; - in "<itemizedlist>${lib.concatStringsSep "\n" (map (p: describe (unpack p)) packages)}</itemizedlist>"; - + # Clean up declaration sites to not refer to the NixOS source tree. optionsList' = lib.flip map optionsList (opt: opt // { - # Clean up declaration sites to not refer to the NixOS source tree. 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; } - // lib.optionalAttrs (opt ? relatedPackages) { relatedPackages = genRelatedPackages opt.relatedPackages; }); + // lib.optionalAttrs (opt ? type) { type = substFunction opt.type; }); # We need to strip references to /nix/store/* from options, # including any `extraSources` if some modules came from elsewhere, @@ -46,22 +32,8 @@ let prefixesToStrip = map (p: "${toString p}/") ([ ../../.. ] ++ extraSources); stripAnyPrefixes = lib.flip (lib.fold lib.removePrefix) prefixesToStrip; - # Custom "less" that pushes up all the things ending in ".enable*" - # and ".package" - optionListLess = a: b: - let - splt = lib.splitString "."; - ise = lib.hasPrefix "enable"; - isp = lib.hasPrefix "package"; - cmp = lib.splitByAndCompare ise lib.compare - (lib.splitByAndCompare isp lib.compare lib.compare); - in lib.compareLists cmp (splt a) (splt b) < 0; - - # Customly sort option list for the man page. - optionsList'' = lib.sort (a: b: optionListLess a.name b.name) optionsList'; - # Convert the list of options into an XML file. - optionsXML = builtins.toFile "options.xml" (builtins.toXML optionsList''); + optionsXML = builtins.toFile "options.xml" (builtins.toXML optionsList'); optionsDocBook = runCommand "options-db.xml" {} '' optionsXML=${optionsXML} |