diff --git a/nixos/doc/manual/default.nix b/nixos/doc/manual/default.nix index 2c6309474b37..fef6b2f86c85 100644 --- a/nixos/doc/manual/default.nix +++ b/nixos/doc/manual/default.nix @@ -31,11 +31,12 @@ let else p; describe = args: let + title = args.title or null; name = args.name or (lib.concatStringsSep "." args.path); path = args.path or [ args.name ]; package = args.package or (lib.attrByPath path (throw "Invalid package attribute path `${toString path}'") pkgs); in "" - + "pkgs.${name} (${package.meta.name})" + + "${lib.optionalString (title != null) "${title} aka "}pkgs.${name} (${package.meta.name})" + lib.optionalString (!package.meta.available) " [UNAVAILABLE]" + ": ${package.meta.description or "???"}." + lib.optionalString (args ? comment) "\n${args.comment}" @@ -51,7 +52,7 @@ let // 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 ? relatedPackages && opt.relatedPackages != []) { relatedPackages = genRelatedPackages opt.relatedPackages; }); # We need to strip references to /nix/store/* from options, # including any `extraSources` if some modules came from elsewhere,